config

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Save

func Save(cfg interface{}, path string) (err error)

func SaveToFile

func SaveToFile(cfg interface{}, f *os.File) error

func Store

func Store(cfg interface{}, path string) error

Types

type APIsConfig

type APIsConfig struct {
	HTTP HTTPConfig `yaml:"http" json:"http"`
	GRPC GRPCConfig `yaml:"grpc" json:"grpc"`
}

func (*APIsConfig) Validate

func (c *APIsConfig) Validate() error

type ClientsConfig

type ClientsConfig struct {
	Device device.Config `yaml:"device" json:"device"`
}

func (*ClientsConfig) Validate

func (c *ClientsConfig) Validate() error

type Config

type Config struct {
	Log                log.Config                 `yaml:"log" json:"log"`
	APIs               APIsConfig                 `yaml:"apis" json:"apis"`
	Clients            ClientsConfig              `yaml:"clients" json:"clients"`
	RemoteProvisioning *remoteProvisioning.Config `yaml:"remoteProvisioning" json:"remoteProvisioning"`
	// contains filtered or unexported fields
}

Config represent application configuration

func DefaultConfig

func DefaultConfig(directory string) Config

func New

func New(configPath string) (Config, error)

func (*Config) SetConfigPath

func (c *Config) SetConfigPath(configPath string)

func (Config) Store

func (c Config) Store() error

func (Config) String

func (c Config) String() string

String return string representation of Config

func (*Config) Validate

func (c *Config) Validate() error

type GRPCConfig

type GRPCConfig struct {
	Enabled     bool `yaml:"enabled" json:"enabled"`
	grpc.Config `yaml:",inline" json:",inline"`
}

type HTTPConfig

type HTTPConfig struct {
	Enabled     bool `yaml:"enabled" json:"enabled"`
	http.Config `yaml:",inline" json:",inline"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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