config

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2017 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveAuthPerHost added in v0.12.0

func ResolveAuthPerHost(authPerHost map[string]Headerer) map[string]http.Header

ResolveAuthPerHost takes a map of strings to Headerer and resolves the Headerers to http.Headers

Types

type BasicCredentials

type BasicCredentials struct {
	User     string `json:"user"`
	Password string `json:"password"`
}

BasicCredentials holds typical credentials used for authentication (user and password). Used for fetching docker images.

type Config

type Config struct {
	AuthPerHost                  map[string]Headerer
	DockerCredentialsPerRegistry map[string]BasicCredentials
	Paths                        ConfigurablePaths
	Stage1                       Stage1Data
}

Config is a single place where configuration for rkt frontend needs resides.

func GetConfig

func GetConfig() (*Config, error)

GetConfig gets the Config instance with configuration taken from default system path (see common.DefaultSystemConfigDir) overridden with configuration from default local path (see common.DefaultLocalConfigDir).

func GetConfigFrom

func GetConfigFrom(dirs ...string) (*Config, error)

GetConfigFrom gets the Config instance with configuration taken from given paths. Subsequent paths override settings from the previous paths.

func GetConfigFromDir

func GetConfigFromDir(dir string) (*Config, error)

GetConfigFromDir gets the Config instance with configuration taken from given directory.

func (*Config) MarshalJSON added in v1.4.0

func (c *Config) MarshalJSON() ([]byte, error)

MarshalJSON marshals the config for user output.

type ConfigurablePaths added in v0.14.0

type ConfigurablePaths struct {
	DataDir         string
	Stage1ImagesDir string
}

ConfigurablePaths holds various paths defined in the configuration.

type Headerer

type Headerer interface {
	GetHeader() http.Header
	SignRequest(r *http.Request) *http.Request
}

Headerer is an interface for getting additional HTTP headers to use when downloading data (images, signatures).

type Stage1Data added in v1.0.0

type Stage1Data struct {
	Name     string
	Version  string
	Location string
}

Stage1 holds name, version and location of a default stage1 image if it was specified in configuration.

Jump to

Keyboard shortcuts

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