config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2016 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDatasourceNotLoaded = errors.New("could not load configuration: no database source specified")

ErrDatasourceNotLoaded is returned when the datasource variable in the configuration file is not loaded properly

Functions

This section is empty.

Types

type APIConfig

type APIConfig struct {
	Port                      int
	HealthPort                int
	Timeout                   time.Duration
	PaginationKey             string
	CertFile, KeyFile, CAFile string
}

APIConfig is the configuration for the API service.

type Config

type Config struct {
	Database *DatabaseConfig
	Updater  *UpdaterConfig
	Notifier *NotifierConfig
	API      *APIConfig
}

Config is the global configuration for an instance of Clair.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig is a configuration that can be used as a fallback value.

func Load

func Load(path string) (config *Config, err error)

Load is a shortcut to open a file, read it, and generate a Config. It supports relative and absolute paths. Given "", it returns DefaultConfig.

type DatabaseConfig

type DatabaseConfig struct {
	Source    string
	CacheSize int
}

DatabaseConfig is the configuration used to specify how Clair connects to a database.

type File

type File struct {
	Clair Config `yaml:"clair"`
}

File represents a YAML configuration file that namespaces all Clair configuration under the top-level "clair" key.

type NotifierConfig

type NotifierConfig struct {
	Attempts         int
	RenotifyInterval time.Duration
	Params           map[string]interface{} `yaml:",inline"`
}

NotifierConfig is the configuration for the Notifier service and its registered notifiers.

type UpdaterConfig

type UpdaterConfig struct {
	Interval time.Duration
}

UpdaterConfig is the configuration for the Updater service.

Jump to

Keyboard shortcuts

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