configuration

package
Version: v0.0.0-...-506b656 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2017 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CurrentVersion is the most recent Version that can be parsed.
	CurrentVersion = MajorMinorVersion(1, 0)

	ErrTypeVersionNotSpecified = "ErrConfigVersionNotSpecified"
	ErrTypeUnsupportedVersion  = "ErrConfigUnsupportedVersion"

	ErrVersionNotSpecified = oerr.NewError(ErrTypeVersionNotSpecified, "Configuration version not specified")
	ErrUnsupportedVersion  = oerr.NewError(ErrTypeUnsupportedVersion, "Unsupported configuration version")
)

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Version  *Version `yaml:"version"`
	Filename string   `yaml:"-"`
	Log      Log      `yaml:"log"`
	HTTP     HTTP     `yaml:"http"`
	Tasks    Tasks    `yaml:"tasks"`
	Docker   Docker   `yaml:"docker"`
	Storage  Storage  `yaml:"storage"`
}

func Parse

func Parse(rd io.Reader) (*Configuration, error)

Parse parses an input configuration and returns docker configuration structure

func ParseFile

func ParseFile(filename string) (*Configuration, error)

type Docker

type Docker struct {
	Addr string `yaml:"addr"`
}

type HTTP

type HTTP struct {
	// Addr specifies the bind address for the registry instance.
	Addr string `yaml:"addr,omitempty"`

	TLS HTTPTLS `yaml:"tls,omitempty"`
}

HTTP contains configuration parameters for the registry's http interface.

type HTTPTLS

type HTTPTLS struct {
	// Certificate specifies the path to an x509 certificate file to
	// be used for TLS.
	Certificate string `yaml:"certificate,omitempty"`

	// Key specifies the path to the x509 key file, which should
	// contain the private portion for the file specified in
	// Certificate.
	Key string `yaml:"key,omitempty"`

	// Specifies the CA certs for client authentication
	// A file may contain multiple CA certificates encoded as PEM
	ClientCAs []string `yaml:"clientcas,omitempty"`
}

TLS instructs the http server to listen with a TLS configuration. This only support simple tls configuration with a cert and key. Mostly, this is useful for testing situations or simple deployments that require tls. If more complex configurations are required, use a proxy or make a proposal to add support here.

type Log

type Log struct {
	// Level is the granularity at which registry operations are logged.
	Level Loglevel `yaml:"level"`

	// Formatter overrides the default formatter with another. Options
	// include "text" and "json".
	Formatter string `yaml:"formatter,omitempty"`
}

Log supports setting various parameters related to the logging subsystem.

type Loglevel

type Loglevel string

Loglevel is the level at which operations are logged This can be error, warn, info, or debug

func (*Loglevel) UnmarshalYAML

func (loglevel *Loglevel) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the yaml.Umarshaler interface Unmarshals a string into a Loglevel, lowercasing the string and validating that it represents a valid loglevel

type Storage

type Storage struct {
	Path string `yaml:"path"`
}

type Tasks

type Tasks struct {
	MaxSize int64 `yaml:"max-size"`
}

type Version

type Version string

Version is a major/minor version pair of the form Major.Minor Major version upgrades indicate structure or type changes Minor version upgrades should be strictly additive

func MajorMinorVersion

func MajorMinorVersion(major, minor uint) Version

MajorMinorVersion constructs a Version from its Major and Minor components

func (Version) Major

func (version Version) Major() uint

Major returns the major version portion of a Version

func (Version) Minor

func (version Version) Minor() uint

Minor returns the minor version portion of a Version

func (Version) Split

func (version Version) Split() (uint, uint, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL