config

package
v0.0.0-...-c22a57c Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileWatcher

func NewFileWatcher(ch chan bool, file string)

New creates new file watcher

Types

type Config

type Config struct {
	Endpoints             []RemoteEndpoint `yaml:"remoteEndpoints"`
	ResourcesWatch        []Resource       `yaml:"resources"`
	NewResources          []Resource
	StaleResources        []Resource
	PrometheusMetrics     PrometheusConfig       `yaml:"prometheusMetrics"`
	ClusterName           string                 `yaml:"clusterName"`
	DeltaUpdates          bool                   `yaml:"deltaUpdates"`
	DelayStartSeconds     string                 `yaml:"delayAddEventDuration"`
	EmitCacheDuration     string                 `yaml:"emitCacheDuration"`
	EmitBatchMaxObjects   int                    `yaml:"emitBatchMaxObjects"`
	EmitInterval          int                    `yaml:"emitInterval"`
	ForceReuploadDuration string                 `yaml:"forceReuploadDuration"`
	Metadata              map[string]interface{} `yaml:"metadata"`
	HttpLiveness          HttpLivenessConfig     `yaml:"httpLiveness"`
	IgnoreNamespaces      []string               `yaml:"ignoreNamespaces"`
}

func ReadConfig

func ReadConfig(configPath string) (*Config, error)

ReadConfig reads info from a config file based on the passed configPath. If there's an issue locating, reading, or parsing the config, an error is returned.

func (*Config) DiffConfig

func (c *Config) DiffConfig(old, new []Resource)

type FieldPruner

type FieldPruner map[string][]string

type HttpLivenessConfig

type HttpLivenessConfig struct {
	Port string `yaml:"port"`
	Path string `yaml:"path"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Port string `yaml:"port"`
	Path string `yaml:"path"`
}

type RemoteEndpoint

type RemoteEndpoint struct {
	Type          string   `yaml:"type"`
	Region        string   `yaml:"region"`
	Url           string   `yaml:"url"`
	Namespaces    []string `yaml:"namespaces"`
	ResourceTypes []string `yaml:"resourceTypes"`
	UsernameVar   string   `yaml:"usernameVar"`
	PasswordVar   string   `yaml:"passwordVar"`
}

type Resource

type Resource struct {
	Name         string   `yaml:"name"`
	AssetId      string   `yaml:"assetId"`
	PruneFields  []string `yaml:"pruneFields"`
	FilterEvents []string `yaml:"filterEvents"`
}

Jump to

Keyboard shortcuts

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