Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrorCode ¶
type ErrorCode struct { Code string `json:"code"` Message string `json:"message"` Detail map[string]any `json:"detail,omitempty"` }
ErrorCode represents an individual error in the response
type ErrorResponse ¶
ErrorResponse represents a custom error response
type ManifestContent ¶
type ManifestContent struct { Content []byte MediaType string Digest digest.Digest Referrers []descriptor.Descriptor ArtifactType string }
ManifestContent represents a manifest and its metadata
type MockRegistry ¶
type MockRegistry struct {
// contains filtered or unexported fields
}
MockRegistry provides a mock OCI registry implementation (distribution-spec)
func NewMockRegistry ¶
func NewMockRegistry(content *RegistryContent) *MockRegistry
NewMockRegistry creates a new mock registry server
func (*MockRegistry) Close ¶
func (m *MockRegistry) Close()
Close shuts down the mock registry server
func (*MockRegistry) URL ¶
func (m *MockRegistry) URL() string
URL returns the URL of the mock registry
type RegistryContent ¶
type RegistryContent struct { // Map of repository names to their content Repositories map[string]*RepositoryContent // Optional custom error responses ErrorResponses map[string]ErrorResponse // Optional custom headers for responses CustomHeaders map[string]map[string]string }
RegistryContent represents the content stored in the mock registry
type RepositoryContent ¶
type RepositoryContent struct { // Map of tag names to manifest digests Tags map[string]string // Map of manifest digests to their content Manifests map[string]ManifestContent // Map of blob digests to their content Blobs map[string][]byte // Map of upload UUIDs to their partial content Uploads map[string]*UploadState // Optional minimum chunk size for uploads MinChunkSize int64 }
RepositoryContent represents content within a repository
Click to show internal directories.
Click to hide internal directories.