Documentation ¶
Index ¶
- type BinaryResponse
- type DynamicRegistries
- type FileResponse
- type HTTPResponse
- type JSONResponse
- type ManifestInfo
- type Registries
- type Registry
- func (r *Registry) AppendUpload(ctx context.Context, uuid string, pos int64, in io.Reader) (int64, error)
- func (r *Registry) CompleteUpload(ctx context.Context, uuid string, digest string) (string, error)
- func (r *Registry) CreateManifest(ctx context.Context, tag string, b []byte) error
- func (r *Registry) ListTags(ctx context.Context) (*Tags, error)
- func (r *Registry) ReadManifest(ctx context.Context, tag string) ([]byte, error)
- func (r *Registry) ServeBlob(ctx context.Context, blob string) (Response, error)
- func (r *Registry) StartUpload(ctx context.Context) (string, error)
- func (r *Registry) UploadPosition(ctx context.Context, uuid string) (int64, error)
- type RegistryOption
- type Response
- type Server
- type ServerOption
- type StaticRegistries
- type StreamingResponse
- type Tags
- type TextResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BinaryResponse ¶
func (*BinaryResponse) WriteTo ¶
func (v *BinaryResponse) WriteTo(w http.ResponseWriter, r *http.Request)
type DynamicRegistries ¶
type DynamicRegistries struct {
// contains filtered or unexported fields
}
func NewDynamicRegistries ¶
func NewDynamicRegistries(baseDir string, options []RegistryOption) *DynamicRegistries
func (*DynamicRegistries) FindRegistry ¶
type FileResponse ¶
func (*FileResponse) WriteTo ¶
func (v *FileResponse) WriteTo(w http.ResponseWriter, r *http.Request)
type HTTPResponse ¶
func ErrorResponse ¶
func ErrorResponse(statusCode int) *HTTPResponse
func (*HTTPResponse) WriteTo ¶
func (v *HTTPResponse) WriteTo(w http.ResponseWriter, r *http.Request)
type JSONResponse ¶
type JSONResponse struct {
Object interface{}
}
func (*JSONResponse) WriteTo ¶
func (v *JSONResponse) WriteTo(w http.ResponseWriter, r *http.Request)
type ManifestInfo ¶
type Registries ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages a single oci registry. Our registries serve a single named image, with multiple tags.
func NewRegistry ¶
func NewRegistry(name string, rootDir string, options ...RegistryOption) (*Registry, error)
NewRegistry constructs an instance of Registry
func (*Registry) AppendUpload ¶
func (*Registry) CompleteUpload ¶
func (*Registry) CreateManifest ¶
func (*Registry) ReadManifest ¶
type RegistryOption ¶
type RegistryOption interface {
// contains filtered or unexported methods
}
RegistryOption is implemented by configuration settings for git repository.
func WithBasicAuth ¶
func WithBasicAuth(username, password string) RegistryOption
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a mock OCI server implementing "just enough" of the oci protocol
func NewServer ¶
func NewServer(registries Registries, opts ...ServerOption) (*Server, error)
NewGitServer constructs a GitServer backed by the specified repo.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
ServerOption follows the option pattern for customizing the server
type StaticRegistries ¶
type StaticRegistries struct {
// contains filtered or unexported fields
}
StaticRegistries holds fixed registries
func NewStaticRegistries ¶
func NewStaticRegistries() *StaticRegistries
NewStaticRegistries constructs an instance of StaticRegistries
func (*StaticRegistries) Add ¶
func (r *StaticRegistries) Add(id string, repo *Registry) error
Add registers a git repository under the specified id
func (*StaticRegistries) FindRegistry ¶
FindRegistry returns a registry registered under the specified id, or nil if none is registered.
type StreamingResponse ¶
type StreamingResponse struct { ContentType string Body io.ReadCloser }
func (*StreamingResponse) WriteTo ¶
func (v *StreamingResponse) WriteTo(w http.ResponseWriter, r *http.Request)
type Tags ¶
type Tags struct { Name string `json:"name"` Manifests map[string]ManifestInfo `json:"manifest"` Tags []string `json:"tags"` Children []string `json:"child"` }
type TextResponse ¶
type TextResponse struct {
Body string
}
func (*TextResponse) WriteTo ¶
func (v *TextResponse) WriteTo(w http.ResponseWriter, r *http.Request)