Files
ollama/registry/apitypes.go
Blake Mizerany eb2c442a01 oweb: make DecodeUserJSON take a field name
This allows for better error messages when decoding fails. For example,
instead of:

    {"code":"invalid_json","message":"unexpected end of JSON input"}

We now get:

    {"code":"invalid_json","field":"manifest","message":"unexpected end of JSON input"}
2024-03-31 11:36:51 -07:00

31 lines
620 B
Go

package registry
import "encoding/json"
type Manifest struct {
Layers []Layer `json:"layers"`
}
type Layer struct {
Digest string `json:"digest"`
MediaType string `json:"mediaType"`
Size int64 `json:"size"`
}
type PushRequest struct {
Ref string `json:"ref"`
Manifest json.RawMessage
}
type Requirement struct {
Digest string `json:"digest"`
Size int64 `json:"size"`
URL string `json:"url"`
}
type PushResponse struct {
// Requirements is a list of digests that the client needs to push before
// repushing the manifest.
Requirements []Requirement `json:"requirements,omitempty"`
}