Compare commits
7 Commits
32c0d85bad
...
cd4b5e0598
| Author | SHA1 | Date | |
|---|---|---|---|
| cd4b5e0598 | |||
| e583780b9c | |||
| c0ed8a590e | |||
| 09d3450738 | |||
| f01b15c8c6 | |||
| 27ac30d28a | |||
| 0424de1fca |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
|||||||
|
dist/
|
||||||
tmp/
|
tmp/
|
||||||
__*.exe
|
__*.exe
|
||||||
@@ -5,7 +5,9 @@ before:
|
|||||||
- go mod tidy
|
- go mod tidy
|
||||||
|
|
||||||
builds:
|
builds:
|
||||||
- env:
|
- ldflags:
|
||||||
|
- -X s1d3sw1ped/SteamCache2/version.Version={{.Version}}
|
||||||
|
env:
|
||||||
- CGO_ENABLED=0
|
- CGO_ENABLED=0
|
||||||
goos:
|
goos:
|
||||||
- linux
|
- linux
|
||||||
|
|||||||
9
.vscode/launch.json
vendored
9
.vscode/launch.json
vendored
@@ -11,9 +11,12 @@
|
|||||||
"mode": "auto",
|
"mode": "auto",
|
||||||
"program": "${workspaceFolder}/main.go",
|
"program": "${workspaceFolder}/main.go",
|
||||||
"args": [
|
"args": [
|
||||||
"--memory", "1G",
|
"--memory",
|
||||||
"--disk", "10G",
|
"1G",
|
||||||
"--disk-path", "tmp/disk",
|
"--disk",
|
||||||
|
"10G",
|
||||||
|
"--disk-path",
|
||||||
|
"tmp/disk",
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -55,7 +55,8 @@ This will direct any requests to `lancache.steamcontent.com` to your SteamCache2
|
|||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
This project is licensed. See the [LICENSE](LICENSE) file for details.
|
See the [LICENSE](LICENSE) file for details.
|
||||||
|
But just for clarity this covers all files in this project unless stated in the individual file.
|
||||||
|
|
||||||
## Acknowledgements
|
## Acknowledgements
|
||||||
|
|
||||||
|
|||||||
21
cmd/root.go
21
cmd/root.go
@@ -1,24 +1,3 @@
|
|||||||
/*
|
|
||||||
Copyright © 2025 s1d3sw1ped
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
package cmd
|
package cmd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
23
cmd/version.go
Normal file
23
cmd/version.go
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"s1d3sw1ped/SteamCache2/version"
|
||||||
|
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 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.`,
|
||||||
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
fmt.Fprintln(os.Stderr, "SteamCache2", version.Version)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rootCmd.AddCommand(versionCmd)
|
||||||
|
}
|
||||||
5
main.go
5
main.go
@@ -21,7 +21,10 @@ THE SOFTWARE.
|
|||||||
*/
|
*/
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import "s1d3sw1ped/SteamCache2/cmd"
|
import (
|
||||||
|
"s1d3sw1ped/SteamCache2/cmd"
|
||||||
|
_ "s1d3sw1ped/SteamCache2/version" // Import the version package for global version variable
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cmd.Execute()
|
cmd.Execute()
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"s1d3sw1ped/SteamCache2/steamcache/avgcachestate"
|
"s1d3sw1ped/SteamCache2/steamcache/avgcachestate"
|
||||||
"s1d3sw1ped/SteamCache2/steamcache/logger"
|
"s1d3sw1ped/SteamCache2/steamcache/logger"
|
||||||
|
"s1d3sw1ped/SteamCache2/version"
|
||||||
"s1d3sw1ped/SteamCache2/vfs"
|
"s1d3sw1ped/SteamCache2/vfs"
|
||||||
"s1d3sw1ped/SteamCache2/vfs/cache"
|
"s1d3sw1ped/SteamCache2/vfs/cache"
|
||||||
"s1d3sw1ped/SteamCache2/vfs/cachestate"
|
"s1d3sw1ped/SteamCache2/vfs/cachestate"
|
||||||
@@ -81,7 +82,7 @@ func New(address string, memorySize string, memoryMultiplier int, diskSize strin
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (sc *SteamCache) Run() {
|
func (sc *SteamCache) Run() {
|
||||||
logger.Logger.Info().Str("address", sc.address).Msg("listening")
|
logger.Logger.Info().Str("address", sc.address).Str("version", version.Version).Msg("listening")
|
||||||
|
|
||||||
sc.mu.Lock()
|
sc.mu.Lock()
|
||||||
sc.dirty = true
|
sc.dirty = true
|
||||||
|
|||||||
3
version/version.go
Normal file
3
version/version.go
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
package version
|
||||||
|
|
||||||
|
var Version string
|
||||||
Reference in New Issue
Block a user