config

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigurationManager

type ConfigurationManager struct {
	// contains filtered or unexported fields
}

func NewConfigurationManager

func NewConfigurationManager(
	ctx context.Context,
	configPath string,
) (*ConfigurationManager, error)

func (*ConfigurationManager) GetAllPaths

func (cm *ConfigurationManager) GetAllPaths() ([]string, error)

func (*ConfigurationManager) GetAs

func (cm *ConfigurationManager) GetAs(path string, target interface{}) error

func (*ConfigurationManager) GetConfig

func (cm *ConfigurationManager) GetConfig() *types.ServiceConfig

func (*ConfigurationManager) GetRawData

func (cm *ConfigurationManager) GetRawData() map[string]interface{}

func (*ConfigurationManager) GetValue

func (cm *ConfigurationManager) GetValue(path string, defaultValue interface{}) interface{}

func (*ConfigurationManager) IsRunning

func (cm *ConfigurationManager) IsRunning() bool

func (*ConfigurationManager) Load

func (cm *ConfigurationManager) Load() error

func (*ConfigurationManager) Start

func (cm *ConfigurationManager) Start() error

func (*ConfigurationManager) Stop

func (cm *ConfigurationManager) Stop() error

type Loader

type Loader struct {
	// contains filtered or unexported fields
}

func NewLoader

func NewLoader() (*Loader, error)

func (*Loader) Defaults

func (l *Loader) Defaults() *types.ServiceConfig

func (*Loader) IsRunning

func (l *Loader) IsRunning() bool

func (*Loader) LoadFromFile

func (l *Loader) LoadFromFile(ctx context.Context, configPath string) (*types.ServiceConfig, *map[string]interface{}, error)

func (*Loader) ReadFileWithTimeout

func (l *Loader) ReadFileWithTimeout(ctx context.Context, filepath string) ([]byte, error)

func (*Loader) Start

func (l *Loader) Start() error

func (*Loader) Stop

func (l *Loader) Stop() error

func (*Loader) ValidateConfig

func (l *Loader) ValidateConfig(config *types.ServiceConfig) error

type LoaderState

type LoaderState int32
const (
	LoaderStateStopped LoaderState = iota
	LoaderStateStarting
	LoaderStateRunning
	LoaderStateStopping
)

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func NewParser

func NewParser(config *map[string]interface{}) *Parser

func (*Parser) GetAllPaths

func (p *Parser) GetAllPaths() ([]string, error)

func (*Parser) GetAs

func (p *Parser) GetAs(path string, target interface{}) error

func (*Parser) GetValue

func (p *Parser) GetValue(path string, defaultValue interface{}) interface{}

func (*Parser) IsRunning

func (p *Parser) IsRunning() bool

func (*Parser) Start

func (p *Parser) Start() error

func (*Parser) Stop

func (p *Parser) Stop() error

func (*Parser) ValidatePath

func (p *Parser) ValidatePath(path string) error

type ParserState

type ParserState int32
const (
	ParserStateStopped ParserState = iota
	ParserStateStarting
	ParserStateRunning
	ParserStateStopping
)

type State

type State int32
const (
	StateStopped State = iota
	StateStarting
	StateRunning
	StateStopping
)

Jump to

Keyboard shortcuts

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