{"modulePath":"github.com/flashbots/cvm-reverse-proxy","version":"v0.1.9","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package client\n\npackage client contains code to manage CVM versions in Constellation's CDN API. It is used to upload and delete \"latest\" versions for AMD SEV-SNP and Intel TDX.\n\n## Constants\n\n```go\nconst VersionFormat = \"2006-01-02-15-04\"\n```\nVersionFormat is the format of the version name in the S3 bucket.\n\n## Variables\n\n```go\nvar ErrNoNewerVersion = errors.New(\"input version is not newer than latest API version\")\n```\nErrNoNewerVersion is returned if the input version is not newer than the latest API version.\n\n## Functions\n\n```go\nfunc IsInputNewerThanOtherVersion(variant variant.Variant, inputVersion, otherVersion any) bool\n```\nIsInputNewerThanOtherVersion compares the input version with the other version and returns true if the input version is newer. This function panics if the input versions are not TDX or SEV-SNP versions.\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\nClient manages (modifies) the version information for the attestation variants.\n\n```go\nfunc New(ctx context.Context, cfg staticupload.Config, cosignPwd, privateKey []byte, dryRun bool, versionWindowSize int, log *slog.Logger) (*Client, apiclient.CloseFunc, error)\n```\nNew returns a new Client.\n\n```go\nfunc (c Client) DeleteVersion(ctx context.Context, attestation variant.Variant, versionStr string) error\n```\nDeleteVersion deletes the given version (without .json suffix) from the API.\n\n```go\nfunc (c Client) List(ctx context.Context, attestation variant.Variant) (attestationconfigapi.List, error)\n```\nList returns the list of versions for the given attestation variant.\n\n```go\nfunc (c Client) UploadLatestVersion(\n\tctx context.Context, attestationVariant variant.Variant,\n\tinputVersion, latestVersionInAPI any,\n\tnow time.Time, force bool,\n) error\n```\nUploadLatestVersion saves the given version to the cache, determines the smallest TCB version in the cache among the last cacheWindowSize versions and updates the latest version in the API if there is an update. force can be used to bypass the validation logic against the cached versions.\n\n","path":"github.com/flashbots/cvm-reverse-proxy/internal/api/attestationconfigapi/cli/client","name":"client","synopsis":"package client contains code to manage CVM versions in Constellation's CDN API.","isRedistributable":true}
