Refactor module naming and update references to steamcache2
All checks were successful
Release Tag / release (push) Successful in 9s
All checks were successful
Release Tag / release (push) Successful in 9s
- Changed module name from `s1d3sw1ped/SteamCache2` to `s1d3sw1ped/steamcache2` for consistency. - Updated all import paths and references throughout the codebase to reflect the new module name. - Adjusted README and Makefile to use the updated module name, ensuring clarity in usage instructions.
This commit is contained in:
@@ -11,8 +11,8 @@ builds:
|
||||
- -s
|
||||
- -w
|
||||
- -extldflags "-static"
|
||||
- -X s1d3sw1ped/SteamCache2/version.Version={{.Version}}
|
||||
- -X s1d3sw1ped/SteamCache2/version.Date={{.Date}}
|
||||
- -X s1d3sw1ped/steamcache2/version.Version={{.Version}}
|
||||
- -X s1d3sw1ped/steamcache2/version.Date={{.Date}}
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goos:
|
||||
|
||||
2
Makefile
2
Makefile
@@ -13,7 +13,7 @@ build-snapshot-single: deps test ## Build a snapshot of the application for the
|
||||
@goreleaser build --single-target --snapshot --clean
|
||||
|
||||
help: ## Show this help message
|
||||
@echo SteamCache2 Makefile
|
||||
@echo steamcache2 Makefile
|
||||
@echo Available targets:
|
||||
@echo run Run the application
|
||||
@echo run-debug Run the application with debug logging
|
||||
|
||||
@@ -21,7 +21,7 @@ SteamCache2 is a blazing fast download cache for Steam, designed to reduce bandw
|
||||
1. **Clone and build:**
|
||||
```bash
|
||||
git clone <repository-url>
|
||||
cd SteamCache2
|
||||
cd steamcache2
|
||||
make # This will run tests and build the application
|
||||
```
|
||||
|
||||
|
||||
20
cmd/root.go
20
cmd/root.go
@@ -4,10 +4,10 @@ package cmd
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"s1d3sw1ped/SteamCache2/config"
|
||||
"s1d3sw1ped/SteamCache2/steamcache"
|
||||
"s1d3sw1ped/SteamCache2/steamcache/logger"
|
||||
"s1d3sw1ped/SteamCache2/version"
|
||||
"s1d3sw1ped/steamcache2/config"
|
||||
"s1d3sw1ped/steamcache2/steamcache"
|
||||
"s1d3sw1ped/steamcache2/steamcache/logger"
|
||||
"s1d3sw1ped/steamcache2/version"
|
||||
"strings"
|
||||
|
||||
"github.com/rs/zerolog"
|
||||
@@ -25,9 +25,9 @@ var (
|
||||
)
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "SteamCache2",
|
||||
Short: "SteamCache2 is a caching solution for Steam game updates and installations",
|
||||
Long: `SteamCache2 is a caching solution designed to optimize the delivery of Steam game updates and installations.
|
||||
Use: "steamcache2",
|
||||
Short: "steamcache2 is a caching solution for Steam game updates and installations",
|
||||
Long: `steamcache2 is a caching solution designed to optimize the delivery of Steam game updates and installations.
|
||||
It reduces bandwidth usage and speeds up the download process by caching game files locally.
|
||||
This tool is particularly useful for environments with multiple Steam users, such as gaming cafes or households with multiple gamers.
|
||||
By caching game files, SteamCache2 ensures that subsequent downloads of the same files are served from the local cache,
|
||||
@@ -53,7 +53,7 @@ var rootCmd = &cobra.Command{
|
||||
logger.Logger = zerolog.New(writer).With().Timestamp().Logger()
|
||||
|
||||
logger.Logger.Info().
|
||||
Msg("SteamCache2 " + version.Version + " " + version.Date + " starting...")
|
||||
Msg("steamcache2 " + version.Version + " " + version.Date + " starting...")
|
||||
|
||||
// Load configuration
|
||||
cfg, err := config.LoadConfig(configPath)
|
||||
@@ -121,11 +121,11 @@ var rootCmd = &cobra.Command{
|
||||
)
|
||||
|
||||
logger.Logger.Info().
|
||||
Msg("SteamCache2 " + version.Version + " started on " + cfg.ListenAddress)
|
||||
Msg("steamcache2 " + version.Version + " started on " + cfg.ListenAddress)
|
||||
|
||||
sc.Run()
|
||||
|
||||
logger.Logger.Info().Msg("SteamCache2 stopped")
|
||||
logger.Logger.Info().Msg("steamcache2 stopped")
|
||||
os.Exit(0)
|
||||
},
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ package cmd
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"s1d3sw1ped/SteamCache2/version"
|
||||
"s1d3sw1ped/steamcache2/version"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
@@ -12,10 +12,10 @@ import (
|
||||
// versionCmd represents the version command
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "prints the version of SteamCache2",
|
||||
Long: `Prints the version of SteamCache2. This command is useful for checking the version of the application.`,
|
||||
Short: "prints the version of steamcache2",
|
||||
Long: `Prints the version of steamcache2. This command is useful for checking the version of the application.`,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Fprintln(os.Stderr, "SteamCache2", version.Version, version.Date)
|
||||
fmt.Fprintln(os.Stderr, "steamcache2", version.Version, version.Date)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
2
go.mod
2
go.mod
@@ -1,4 +1,4 @@
|
||||
module s1d3sw1ped/SteamCache2
|
||||
module s1d3sw1ped/steamcache2
|
||||
|
||||
go 1.23.0
|
||||
|
||||
|
||||
4
main.go
4
main.go
@@ -2,8 +2,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"s1d3sw1ped/SteamCache2/cmd"
|
||||
_ "s1d3sw1ped/SteamCache2/version" // Import the version package for global version variable
|
||||
"s1d3sw1ped/steamcache2/cmd"
|
||||
_ "s1d3sw1ped/steamcache2/version" // Import the version package for global version variable
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
@@ -13,15 +13,15 @@ import (
|
||||
"net/url"
|
||||
"os"
|
||||
"regexp"
|
||||
"s1d3sw1ped/SteamCache2/steamcache/logger"
|
||||
"s1d3sw1ped/SteamCache2/vfs"
|
||||
"s1d3sw1ped/SteamCache2/vfs/adaptive"
|
||||
"s1d3sw1ped/SteamCache2/vfs/cache"
|
||||
"s1d3sw1ped/SteamCache2/vfs/disk"
|
||||
"s1d3sw1ped/SteamCache2/vfs/gc"
|
||||
"s1d3sw1ped/SteamCache2/vfs/memory"
|
||||
"s1d3sw1ped/SteamCache2/vfs/predictive"
|
||||
"s1d3sw1ped/SteamCache2/vfs/warming"
|
||||
"s1d3sw1ped/steamcache2/steamcache/logger"
|
||||
"s1d3sw1ped/steamcache2/vfs"
|
||||
"s1d3sw1ped/steamcache2/vfs/adaptive"
|
||||
"s1d3sw1ped/steamcache2/vfs/cache"
|
||||
"s1d3sw1ped/steamcache2/vfs/disk"
|
||||
"s1d3sw1ped/steamcache2/vfs/gc"
|
||||
"s1d3sw1ped/steamcache2/vfs/memory"
|
||||
"s1d3sw1ped/steamcache2/vfs/predictive"
|
||||
"s1d3sw1ped/steamcache2/vfs/warming"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
4
vfs/cache/cache.go
vendored
4
vfs/cache/cache.go
vendored
@@ -3,8 +3,8 @@ package cache
|
||||
|
||||
import (
|
||||
"io"
|
||||
"s1d3sw1ped/SteamCache2/vfs"
|
||||
"s1d3sw1ped/SteamCache2/vfs/vfserror"
|
||||
"s1d3sw1ped/steamcache2/vfs"
|
||||
"s1d3sw1ped/steamcache2/vfs/vfserror"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
)
|
||||
|
||||
@@ -7,9 +7,9 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"s1d3sw1ped/SteamCache2/steamcache/logger"
|
||||
"s1d3sw1ped/SteamCache2/vfs"
|
||||
"s1d3sw1ped/SteamCache2/vfs/vfserror"
|
||||
"s1d3sw1ped/steamcache2/steamcache/logger"
|
||||
"s1d3sw1ped/steamcache2/vfs"
|
||||
"s1d3sw1ped/steamcache2/vfs/vfserror"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -186,9 +186,7 @@ func (d *DiskFS) init() {
|
||||
// Extract key from sharded path: remove root and convert sharding back
|
||||
// Handle both "./disk" and "disk" root paths
|
||||
rootPath := d.root
|
||||
if strings.HasPrefix(rootPath, "./") {
|
||||
rootPath = rootPath[2:] // Remove "./" prefix
|
||||
}
|
||||
rootPath = strings.TrimPrefix(rootPath, "./")
|
||||
relPath := strings.ReplaceAll(npath[len(rootPath)+1:], "\\", "/")
|
||||
|
||||
// Extract the original key from the sharded path
|
||||
|
||||
@@ -4,9 +4,9 @@ package gc
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"s1d3sw1ped/SteamCache2/vfs"
|
||||
"s1d3sw1ped/SteamCache2/vfs/disk"
|
||||
"s1d3sw1ped/SteamCache2/vfs/memory"
|
||||
"s1d3sw1ped/steamcache2/vfs"
|
||||
"s1d3sw1ped/steamcache2/vfs/disk"
|
||||
"s1d3sw1ped/steamcache2/vfs/memory"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package memory
|
||||
|
||||
import (
|
||||
"s1d3sw1ped/SteamCache2/vfs"
|
||||
"s1d3sw1ped/steamcache2/vfs"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"bytes"
|
||||
"container/list"
|
||||
"io"
|
||||
"s1d3sw1ped/SteamCache2/vfs/types"
|
||||
"s1d3sw1ped/SteamCache2/vfs/vfserror"
|
||||
"s1d3sw1ped/steamcache2/vfs/types"
|
||||
"s1d3sw1ped/steamcache2/vfs/vfserror"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -3,7 +3,7 @@ package vfs
|
||||
|
||||
import (
|
||||
"io"
|
||||
"s1d3sw1ped/SteamCache2/vfs/types"
|
||||
"s1d3sw1ped/steamcache2/vfs/types"
|
||||
)
|
||||
|
||||
// VFS defines the interface for virtual file systems
|
||||
|
||||
@@ -2,7 +2,7 @@ package warming
|
||||
|
||||
import (
|
||||
"context"
|
||||
"s1d3sw1ped/SteamCache2/vfs"
|
||||
"s1d3sw1ped/steamcache2/vfs"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
Reference in New Issue
Block a user