package factory

import "github.com/docker/distribution/registry/storage/driver/factory"

Index

Functions

func Create

func Create(name string, parameters map[string]interface{}) (storagedriver.StorageDriver, error)

Create a new storagedriver.StorageDriver with the given name and parameters To run in-process, the StorageDriverFactory must first be registered with the given name If no in-process drivers are found with the given name, this attempts to create an IPC driver If no in-process or external drivers are found, an InvalidStorageDriverError is returned

func Register

func Register(name string, factory StorageDriverFactory)

Register makes a storage driver available by the provided name. If Register is called twice with the same name or if driver factory is nil, it panics.

Types

type InvalidStorageDriverError

type InvalidStorageDriverError struct {
	Name string
}

InvalidStorageDriverError records an attempt to construct an unregistered storage driver

func (InvalidStorageDriverError) Error

func (err InvalidStorageDriverError) Error() string

type StorageDriverFactory

type StorageDriverFactory interface {
	// Create returns a new storagedriver.StorageDriver with the given parameters
	// Parameters will vary by driver and may be ignored
	// Each parameter key must only consist of lowercase letters and numbers
	Create(parameters map[string]interface{}) (storagedriver.StorageDriver, error)
}

StorageDriverFactory is a factory interface for creating storagedriver.StorageDriver interfaces Storage drivers should call Register() with a factory to make the driver available by name

Source Files

factory.go

Version
v2.0.0-rc.3+incompatible
Published
Apr 10, 2015
Platform
js/wasm
Imports
2 packages
Last checked
16 hours ago

Tools for package owners.