config

package
v0.48.3 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: GPL-3.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logger     loggerconfig.Logger         `mapstructure:"logger"`
	Pprof      serviceconfig.Service       `mapstructure:"pprof"`
	Prometheus serviceconfig.Service       `mapstructure:"prometheus"`
	Meta       metaconfig.Meta             `mapstructure:"metadata"`
	Node       nodeconfig.Node             `mapstructure:"node"`
	GRPC       []grpcconfig.GRPC           `mapstructure:"grpc"`
	Control    controlconfig.Control       `mapstructure:"control"`
	FSChain    fschainconfig.Chain         `mapstructure:"fschain"`
	APIClient  apiclientconfig.APIClient   `mapstructure:"apiclient"`
	Policer    policerconfig.Policer       `mapstructure:"policer"`
	Replicator replicatorconfig.Replicator `mapstructure:"replicator"`
	Object     objectconfig.Object         `mapstructure:"object"`
	Storage    engineconfig.Storage        `mapstructure:"storage"`
	// contains filtered or unexported fields
}

Config contains all configuration parameters of the node.

func New

func New(opts ...Option) (*Config, error)

New creates a new Config instance.

If file option is provided (WithConfigFile), configuration values are read from it. Otherwise, Config is filled with default values.

func (*Config) IsSet added in v0.46.0

func (c *Config) IsSet(key string) bool

IsSet checks if the key is set in the config.

func (*Config) Normalize added in v0.46.0

func (c *Config) Normalize()

Normalize sets default values for all fields of Config. If some of fields are not set or have invalid values, they will be set to default values.

func (*Config) Path added in v0.46.0

func (c *Config) Path() string

Path returns the file system path to the configuration file being used by the Config instance. If no path was set, it returns an empty string.

func (*Config) Set added in v0.46.0

func (c *Config) Set(key string)

Set specifies that the key has been set in the config.

func (*Config) Unset added in v0.46.0

func (c *Config) Unset(key string)

Unset ensures that the key is unset in the config.

func (*Config) UnsetAll added in v0.46.0

func (c *Config) UnsetAll()

UnsetAll unsets all keys from config.

type Option

type Option func(*opts)

Option allows to set an optional parameter of the Config.

func WithConfigFile

func WithConfigFile(path string) Option

WithConfigFile returns an option to set the system path to the configuration file.

Jump to

Keyboard shortcuts

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