diff --git a/go.mod b/go.mod index aae7ac987..7c3a75108 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/threefoldtech/tfchain/clients/tfchain-client-go v0.0.0-20241127100051-77e684bcb1b2 github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.16.1-0.20241229121208-76ac3fea5e67 github.com/threefoldtech/zbus v1.0.1 - github.com/threefoldtech/zosbase v0.1.2 + github.com/threefoldtech/zosbase v0.1.3-0.20250224102619-a2206c717b94 github.com/urfave/cli/v2 v2.17.2-0.20221006022127-8f469abc00aa gopkg.in/yaml.v2 v2.4.0 ) @@ -55,8 +55,7 @@ require ( github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gtank/merlin v0.1.1 // indirect - github.com/hashicorp/go-cleanhttp v0.5.2 // indirect - github.com/hashicorp/go-retryablehttp v0.7.7 // indirect + github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d // indirect github.com/hasura/go-graphql-client v0.10.0 // indirect github.com/jbenet/go-base58 v0.0.0-20150317085156-6237cf65f3a6 // indirect @@ -106,7 +105,6 @@ require ( github.com/hanwen/go-fuse/v2 v2.3.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect - github.com/hashicorp/go-retryablehttp v0.7.7 github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/holiman/uint256 v1.2.3 // indirect github.com/josharian/native v0.0.0-20200817173448-b6b71def0850 // indirect diff --git a/go.sum b/go.sum index 3eefe2b72..1b3534ef5 100644 --- a/go.sum +++ b/go.sum @@ -542,8 +542,8 @@ github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.16.1-0.20241229121208-76ac3 github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.16.1-0.20241229121208-76ac3fea5e67/go.mod h1:93SROfr+QjgaJ5/jIWtIpLkhaD8Pv8WbdfwvwMNG2p4= github.com/threefoldtech/zbus v1.0.1 h1:3KaEpyOiDYAw+lrAyoQUGIvY9BcjVRXlQ1beBRqhRNk= github.com/threefoldtech/zbus v1.0.1/go.mod h1:E/v/xEvG/l6z/Oj0aDkuSUXFm/1RVJkhKBwDTAIdsHo= -github.com/threefoldtech/zosbase v0.1.2 h1:JTwL3FFpYCmsGKsNSzXSDAsuL26LmXDjjGXaGxXtIMU= -github.com/threefoldtech/zosbase v0.1.2/go.mod h1:rxc49wA04S4IsBOYe0omVO7nu7GXridueh2PJh34gSo= +github.com/threefoldtech/zosbase v0.1.3-0.20250224102619-a2206c717b94 h1:ays4QwWQtRC7xBfsbVWM10R+oPWmabxR6MK/vmoYvuU= +github.com/threefoldtech/zosbase v0.1.3-0.20250224102619-a2206c717b94/go.mod h1:rxc49wA04S4IsBOYe0omVO7nu7GXridueh2PJh34gSo= github.com/tinylib/msgp v1.1.5 h1:2gXmtWueD2HefZHQe1QOy9HVzmFrLOVvsXwXBQ0ayy0= github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= diff --git a/pkg/version/README.md b/pkg/version/README.md deleted file mode 100644 index cb70d455e..000000000 --- a/pkg/version/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# version module - -The `version` package provides some utilities to get and display the version of a system, including branch, revision, and the dirty flag status. - -## Constants - -The following are placeholders that are replaced during the build of the system. - -- `Branch`: Represents the branch the system is running of. -- `Revision`: Represents the code revision. -- `Dirty`: Shows if the binary was built from a repo with uncommitted changes. - -## Version Interface - -The `Version` interface defines two methods for retrieving version information - -- `Short() string`: Returns a short representation of the version. -- `String() string`: Returns a detailed representation of the version. - -## Functions - -### `Current()` - -Returns the current version as a `Version` object - -### `ShowAndExit(short bool)` - -Prints the version information and exits the program - -- If `short` is `true`, prints the short version. -- Otherwise, prints the detailed version. - -### `Parse(v string)` - -Parses a version string using regular expressions and extracts the version and revision. Returns an error if the string is invalid diff --git a/pkg/versioned/README.md b/pkg/versioned/README.md deleted file mode 100644 index 82d6882b8..000000000 --- a/pkg/versioned/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# versioned module - -The `versioned` package provides utilities to manage versioned data streams and files. It uses the `blang/semver` package to handle semantic versioning. - -## Error Handling - -`ErrNotVersioned`: Error raised if the underlying reader has no version information. - -`IsNotVersioned`: A function checks if an error is caused by a "not versioned" stream. - -## Structs - -`Reader`: Represents a versioned reader that can load the version of the data from a stream. - -### Fields - -- `Reader io.Reader`: The underlying data stream. -- `version Version`: The version of the data. - -### Methods - -`Version`: Returns the version of the data. - -## Functions - -`NewVersionedReader`: Creates a `Reader` with a specified version. - -`NewReader`: Creates a `Reader` by reading the version from a stream. Fails if the stream lacks version information. - -`ReadFile`: Reads the content of a file and its version. - -`NewWriter`: Creates a versioned writer that marks data with the provided version. - -`WriteFile`: Writes versioned data to a file. - -`Parse`: Parses a version string into a `Version` object. - -`MustParse`: Parses a version string into a `Version` object. Panics if the parsing fails. - -`ParseRange`: Parses a version range string into a `Range` object. - -`MustParseRange`: Parses a version range string into a `Range` object. Panics if the parsing fails. diff --git a/pkg/zos_api/location.go b/pkg/zos_api/location.go deleted file mode 100644 index 2da54e8a9..000000000 --- a/pkg/zos_api/location.go +++ /dev/null @@ -1,27 +0,0 @@ -package zosapi - -import ( - "context" - - "github.com/patrickmn/go-cache" - "github.com/threefoldtech/zos/pkg/geoip" -) - -const ( - locationCacheKey = "location" -) - -func (g *ZosAPI) locationGet(ctx context.Context, payload []byte) (interface{}, error) { - if loc, found := g.inMemCache.Get(locationCacheKey); found { - return loc, nil - } - - loc, err := geoip.Fetch() - if err != nil { - return nil, err - } - - g.inMemCache.Set(locationCacheKey, loc, cache.DefaultExpiration) - - return loc, nil -}