conf

package
v0.0.0-...-b463ae7 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2022 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FlagsForArhatHostConfig

func FlagsForArhatHostConfig(prefix string, config *HostConfig) *pflag.FlagSet

func FlagsForExtensionConfig

func FlagsForExtensionConfig(prefix string, config *ExtensionConfig) *pflag.FlagSet

func ReadConfig

func ReadConfig(
	flags *pflag.FlagSet,
	configFile *string,
	cliLogConfig *log.Config,
	config *Config,
) (context.Context, error)

Types

type AppConfig

type AppConfig struct {
	Log log.ConfigSet `json:"log" yaml:"log"`

	Host HostConfig `json:"host" yaml:"host"`
	Node NodeConfig `json:"node" yaml:"node"`

	PProf perfhelper.PProfConfig `json:"pprof" yaml:"pprof"`
}

AppConfig configuration for arhat application behavior

type Config

type Config struct {
	Arhat        AppConfig                `json:"arhat" yaml:"arhat"`
	Connectivity ConnectivityConfig       `json:"connectivity" yaml:"connectivity"`
	Storage      storageutil.ClientConfig `json:"storage" yaml:"storage"`
	Network      NetworkConfig            `json:"network" yaml:"network"`
	Extension    ExtensionConfig          `json:"extension" yaml:"extension"`
}

Config

type ConnectivityConfig

type ConnectivityConfig struct {
	DialTimeout    time.Duration `json:"dialTimeout" yaml:"dialTimeout"`
	InitialBackoff time.Duration `json:"initialBackoff" yaml:"initialBackoff"`
	MaxBackoff     time.Duration `json:"maxBackoff" yaml:"maxBackoff"`
	BackoffFactor  float64       `json:"backoffFactor" yaml:"backoffFactor"`

	Methods []ConnectivityMethod `json:"methods" yaml:"methods"`
}

ConnectivityConfig configuration for connectivity part in arhat

type ConnectivityMethod

type ConnectivityMethod struct {
	Name     string `json:"name" yaml:"name"`
	Priority int    `json:"priority" yaml:"priority"`

	Config interface{} `json:"config" yaml:"config"`
}

func (*ConnectivityMethod) UnmarshalJSON

func (c *ConnectivityMethod) UnmarshalJSON(data []byte) error

func (*ConnectivityMethod) UnmarshalYAML

func (c *ConnectivityMethod) UnmarshalYAML(value *yaml.Node) error

type ExtensionConfig

type ExtensionConfig struct {
	Enabled bool `json:"enabled" yaml:"enabled"`

	Endpoints  []ExtensionEndpoint       `json:"endpoints" yaml:"endpoints"`
	Peripheral PeripheralExtensionConfig `json:"peripheral" yaml:"peripheral"`
	Runtime    RuntimeExtensionConfig    `json:"runtime" yaml:"runtime"`
}

nolint:maligned

type ExtensionEndpoint

type ExtensionEndpoint struct {
	Listen string `json:"listen" yaml:"listen"`
	TLS    struct {
		tlshelper.TLSConfig `json:",inline" yaml:",inline"`
		VerifyClientCert    bool `json:"verifyClientCert" yaml:"verifyClientCert"`
	} `json:"tls" yaml:"tls"`

	KeepaliveInterval time.Duration `json:"keepaliveInterval" yaml:"keepaliveInterval"`
	MessageTimeout    time.Duration `json:"messageTimeout" yaml:"messageTimeout"`
}

type HostConfig

type HostConfig struct {
	RootFS string `json:"rootfs" yaml:"rootfs"`
	UID    *int   `json:"uid" yaml:"uid"`
	GID    *int   `json:"gid" yaml:"gid"`

	AllowAttach      bool `json:"allowAttach" yaml:"allowAttach"`
	AllowExec        bool `json:"allowExec" yaml:"allowExec"`
	AllowLog         bool `json:"allowLog" yaml:"allowLog"`
	AllowPortForward bool `json:"allowPortForward" yaml:"allowPortForward"`
}

type NetworkConfig

type NetworkConfig struct {
	Enabled bool `json:"enabled" yaml:"enabled"`

	AbbotExec []string `json:"abbotExec" yaml:"abbotExec"`
}

type NodeConfig

type NodeConfig struct {
	MachineIDFrom ValueFromSpec `json:"machineIDFrom" yaml:"machineIDFrom"`
	ExtInfo       []NodeExtInfo `json:"extInfo" yaml:"extInfo"`
}

type NodeExtInfo

type NodeExtInfo struct {
	ValueFrom ValueFromSpec `json:"valueFrom" yaml:"valueFrom"`

	ValueType string `json:"valueType" yaml:"valueType"`
	Operator  string `json:"operator" yaml:"operator"`
	ApplyTo   string `json:"applyTo" yaml:"applyTo"`
}

type PeripheralExtensionConfig

type PeripheralExtensionConfig struct {
	MetricsCacheTimeout time.Duration `json:"metricsCacheTimeout" yaml:"metricsCacheTimeout"`
}

type RuntimeExtensionConfig

type RuntimeExtensionConfig struct {
	Wait bool `json:"wait" yaml:"wait"`
}

type ValueFromSpec

type ValueFromSpec struct {
	Exec []string `json:"exec" yaml:"exec"`
	File string   `json:"file" yaml:"file"`
	Text string   `json:"text" yaml:"text"`
}

func (*ValueFromSpec) Get

func (vf *ValueFromSpec) Get() (string, error)

Jump to

Keyboard shortcuts

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