config

package
v4.0.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IndexerMode receives claircore.Manifests, indexes their contents, and
	// returns claircore.IndexReports.
	IndexerMode = "indexer"
	// MatcherMode populates and updates the vulnerability database and creates
	// claircore.VulnerabilityReports from claircore.IndexReports.
	MatcherMode = "matcher"
	// ComboMode runs all services in a single process.
	ComboMode = "combo"
	// NofitierMode runs a notifier to provide notifications for upstream
	// clients.
	NotifierMode = "notifier"
)

These are the mode arguments that calling code can use in the Mode member of a Config struct. They're called out here for documentation.

View Source
const DefaultAddress = ":6060"

DefaultAddress is used if an http_listen_addr is not provided in the config.

Variables

This section is empty.

Functions

func Validate

func Validate(conf Config) error

Types

type Auth

type Auth struct {
	Name   string            `yaml:"name"`
	Params map[string]string `yaml:"params"`
}

type Config

type Config struct {
	// Mode indicates a Clair node's operational mode.
	//
	// This should be set by code that's populating and validating a config.
	Mode string `yaml:"-"`
	// indicates the HTTP listen address
	HTTPListenAddr string `yaml:"http_listen_addr"`
	// IntrospectionAddr is an address to listen on for introspection http
	// endpoints, e.g. metrics and profiling.
	//
	// If not provided, a random port will be chosen.
	IntrospectionAddr string `yaml:"introspection_addr"`
	// indicates log level for the process
	LogLevel string `yaml:"log_level"`
	// indexer mode specific config
	Indexer Indexer `yaml:"indexer"`
	// matcher mode specific config
	Matcher Matcher `yaml:"matcher"`
	Auth    Auth    `yaml:"auth"`
	// Tracing config
	Trace Trace `yaml:"trace"`
	// Metrics config
	Metrics Metrics `yaml:"metrics"`
}

type Dogstatsd

type Dogstatsd struct {
	URL string `yaml:"url"`
}

type Indexer

type Indexer struct {
	// the conn string to the datastore
	ConnString string `yaml:"connstring"`
	// the interval in seconds to retry a manifest scan if the lock was not acquired
	ScanLockRetry int `yaml:"scanlock_retry"`
	// number of concurrent scans allowed on a manifest's layers. tunable for db performance
	LayerScanConcurrency int `yaml:"layer_scan_concurrency"`
	// should the Indexer be responsible for setting up the database
	Migrations bool `yaml:"migrations"`
}

type Jaeger

type Jaeger struct {
	Agent struct {
		Endpoint string `yaml:"agent_endpoint"`
	} `yaml:",inline"`
	Collector struct {
		Endpoint string  `yaml:"collector_endpoint"`
		Username *string `yaml:"username"`
		Password *string `yaml:"password"`
	} `yaml:",inline"`
	ServiceName string            `yaml:"service_name"`
	Tags        map[string]string `yaml:"tags"`
	BufferMax   int               `yaml:"buffer_max"`
}

type Matcher

type Matcher struct {
	// the conn string to the datastore
	ConnString string `yaml:"connstring"`
	// if sql usage, the connection pool size
	MaxConnPool int `yaml:"max_conn_pool"`
	// the address where the indexer service can be reached
	IndexerAddr string `yaml:"indexer_addr"`
	// should the Matcher be responsible for setting up the database
	Migrations bool `yaml:"migrations"`
	// Updaters is a regexp used to determine which enabled updaters to run.
	Updaters *string `yaml:"updaters"`
}

type Metrics

type Metrics struct {
	Name       string     `yaml:"name"`
	Prometheus Prometheus `yaml:"prometheus"`
	Dogstatsd  Dogstatsd  `yaml:"dogstatsd"`
}

type Prometheus

type Prometheus struct {
	Endpoint *string `yaml:"endpoint"`
}

type Trace

type Trace struct {
	Name        string   `yaml:"name"`
	Probability *float64 `yaml:"probability"`
	Jaeger      Jaeger   `yaml:"jaeger"`
}

Jump to

Keyboard shortcuts

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