web

package
v0.16.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2025 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorBadResponseNewVersionEndpoint        = errors.New("Bad response from new version endpoint")
	ErrorBadResponsePushStartEndpoint         = errors.New("Bad response from push start endpoint")
	ErrorBadResponseInitiateChallengeEndpoint = errors.New("Bad response from start file challenge endpoint")
	ErrorNoSuchDigest                         = errors.New("No digest submitted matches the digest requested")
)

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(dockerCommand command.Command, client *http.Client) *Client

func (*Client) FetchAPIToken added in v0.15.4

func (c *Client) FetchAPIToken(ctx context.Context, entity string) (string, error)

func (*Client) InitiateAndDoFileChallenge

func (c *Client) InitiateAndDoFileChallenge(ctx context.Context, weights []File, files []File) ([]FileChallengeAnswer, error)

func (*Client) PostNewVersion

func (c *Client) PostNewVersion(ctx context.Context, image string, weights []File, files []File, fileChallenges []FileChallengeAnswer) error

func (*Client) PostPushStart

func (c *Client) PostPushStart(ctx context.Context, pushID string, buildTime time.Duration) error

type CogKey added in v0.15.4

type CogKey struct {
	Key       string `json:"key"`
	ExpiresAt string `json:"expires_at"`
}

type Env

type Env struct {
	CogGpu              string `json:"COG_GPU"`
	CogPredictTypeStub  string `json:"COG_PREDICT_TYPE_STUB"`
	CogTrainTypeStub    string `json:"COG_TRAIN_TYPE_STUB"`
	CogPredictCodeStrip string `json:"COG_PREDICT_CODE_STRIP"`
	CogTrainCodeStrip   string `json:"COG_TRAIN_CODE_STRIP"`
	R8CogVersion        string `json:"R8_COG_VERSION"`
	R8CudaVersion       string `json:"R8_CUDA_VERSION"`
	R8CudnnVersion      string `json:"R8_CUDNN_VERSION"`
	R8PythonVersion     string `json:"R8_PYTHON_VERSION"`
	R8TorchVersion      string `json:"R8_TORCH_VERSION"`
}

type File

type File struct {
	Path   string `json:"path"`
	Digest string `json:"digest"`
	Size   int64  `json:"size"`
}

type FileChallenge

type FileChallenge struct {
	Salt   string `json:"salt"`
	Start  int    `json:"byte_start"`
	End    int    `json:"byte_end"`
	Digest string `json:"digest"`
	ID     string `json:"challenge_id"`
}

type FileChallengeAnswer

type FileChallengeAnswer struct {
	Digest      string `json:"digest"`
	Hash        string `json:"hash"`
	ChallengeID string `json:"challenge_id"`
}

type FileChallengeRequest

type FileChallengeRequest struct {
	Digest   string `json:"digest"`
	FileType string `json:"file_type"`
}

type Keys added in v0.15.4

type Keys struct {
	Cog CogKey `json:"cog"`
}

type RuntimeConfig

type RuntimeConfig struct {
	Weights []File `json:"weights"`
	Files   []File `json:"files"`
	Env     Env    `json:"env"`
}

type TokenData added in v0.15.4

type TokenData struct {
	Keys Keys `json:"keys"`
}

type Version

type Version struct {
	Annotations   map[string]string     `json:"annotations"`
	CogConfig     config.Config         `json:"cog_config"`
	CogVersion    string                `json:"cog_version"`
	OpenAPISchema map[string]any        `json:"openapi_schema"`
	RuntimeConfig RuntimeConfig         `json:"runtime_config"`
	Virtual       bool                  `json:"virtual"`
	PushID        string                `json:"push_id"`
	Challenges    []FileChallengeAnswer `json:"file_challenges"`
}

type VersionCreate added in v0.14.9

type VersionCreate struct {
	Version string `json:"version"`
}

type VersionError added in v0.14.4

type VersionError struct {
	Detail  string `json:"detail"`
	Pointer string `json:"pointer"`
}

type VersionErrors added in v0.14.4

type VersionErrors struct {
	Detail string         `json:"detail"`
	Errors []VersionError `json:"errors"`
	Status int            `json:"status"`
	Title  string         `json:"title"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL