Documentation ¶
Overview ¶
Package stori provides the core functionality of the stori registry and aims to be as small as possible.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend interface { Namespace // GetSchema retrieves a valid jsonschema in bytes from the backend. Used to // validate the config files. GetJSONSchema() []byte // Setup passes validated configuration data to the backend for // initialization. Setup(interface{}) error }
Backend is an interface for Stori's persistence layer.
type BlobStore ¶
type BlobStore interface { // GetSchema retrieves a gojsonschema.JSONLoader from the blobstore server // to validate the block in a config file referencing the blobstore. GetSchema() gojsonschema.JSONLoader // Setup passes an empty interface containing configuration data validated // by the JSONLoader recieved from `GetSchema()` Setup(interface{}) error }
BlobStore is an interface for Stori's content-addressable storage engine.
type HandlerProperties ¶
type HandlerProperties struct{ Registry *Registry }
HandlerProperties is the point of integration between the registry HTTP handlers that serve it.
type Namespace ¶
type Namespace interface { // CreateNamespace creates a new namespace in the registry. CreateNamespace(conf NamespaceConfig) (*NamespaceInfo, error) // LookupNamespace performs a lookup on the registry for a namespace // with a name matching the string provided. LookupNamespace(name string) (*NamespaceInfo, error) }
Namespace defines methods backends must implement for working with registry namespaces.
type NamespaceConfig ¶
type NamespaceConfig struct { // Name is the name of the namespace. Must be unique across all namespaces // hosted on the registry. Name string // BlobStorageLimit is the maximum size (in bytes) that the cumulative size // of blobs within a namespace can grow to. Mounted blobs are not counted // towards the limit. BlobStorageLimit uint64 // RepositoryLimit is the maximum allowable amount of repositories that can // be contained within a namespace. RepositoryLimit uint64 // Labels defines optional client-supplied metadata for a namespace. Labels map[string]string }
NamespaceConfig is essentially NamespaceInfo without the NamespaceStatus field. Only the registry can change the status of a namespace. NamespaceConfig should only be used when initially creating a namespace.
type NamespaceInfo ¶
type NamespaceInfo struct { NamespaceConfig // Status defines what phase the namespace is in. Status NamespaceStatus }
NamespaceInfo defines operations for stori namespaces. A namespace is a logical grouping of repositories and a fundamental building block for policy enforcement.
type NamespaceStatus ¶
type NamespaceStatus string
NamespaceStatus represents the current availability of a namespace.
const ( // NamespaceActive when set, notifies clients that the namespace is able to // have content allocated to it. NamespaceActive NamespaceStatus = "Active" // NamespaceTerminating when set, notifies clients that the namespace is not // available to have conent allocated to it. NamespaceTerminating NamespaceStatus = "Terminating" )
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry defines parameters for running a container image registry.
func NewRegistry ¶
func NewRegistry(reg *RegistryConfig) (*Registry, error)
NewRegistry takes a RegistryConfig and returns a fully initialized Registry.
func TestRegistry ¶
TestRegistry returns a fully initialized registry.
type RegistryConfig ¶
RegistryConfig is used to parameterize a registry.
type Repository ¶
type Repository struct { // Name is a name that uniquely identifies a repository within a single // namespace. Name string // ID is a unique value for a particular repository that will change if the // repository is removed from the system and another registry is added with // the same name. RIDs are unique accross the entire registry. ID int32 }
Repository defines the data structures associated with repositories.