config

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetConfig

func SetConfig(key string, value interface{})

func TrySaveToDisk

func TrySaveToDisk(c *Config) error

Types

type Config

type Config struct {
	AgentID                   string              `json:"agentID,omitempty" yaml:"agentID"`
	Metadata                  options.Metadata    `json:"metadata,omitempty" yaml:"metadata"`
	IPDetect                  string              `json:"ipDetect,omitempty" yaml:"ipDetect"`
	RegisterNode              bool                `json:"registerNode,omitempty" yaml:"registerNode"`
	NodeStatusUpdateFrequency time.Duration       `json:"nodeStatusUpdateFrequency,omitempty" yaml:"nodeStatusUpdateFrequency"`
	DownloaderOptions         *downloader.Options `json:"downloader" yaml:"downloader" mapstructure:"downloader"`
	LogOptions                *logger.Options     `json:"log,omitempty" yaml:"log,omitempty" mapstructure:"log"`
	MQOptions                 *natsio.NatsOptions `json:"mq,omitempty" yaml:"mq,omitempty"  mapstructure:"mq"`
	OpLogOptions              *oplog.Options      `json:"oplog,omitempty" yaml:"oplog,omitempty" mapstructure:"oplog"`
	ImageProxyOptions         *imageproxy.Options `json:"imageProxy,omitempty" yaml:"imageProxy,omitempty" mapstructure:"imageProxy"`
}

Config defines everything needed for apiserver to deal with external services

func New

func New() *Config

func TryLoadFromDisk

func TryLoadFromDisk() (*Config, error)

func (*Config) ToMap

func (conf *Config) ToMap() map[string]bool

ToMap convertToMap simply converts config to map[string]bool to hide sensitive information

Jump to

Keyboard shortcuts

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