configurator

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FileName      = "config"
	FileExtension = "json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configurator

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

func New

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

func (*Configurator) Get

func (c *Configurator) Get() (*types.Config, error)

func (*Configurator) GetAllValues

func (c *Configurator) GetAllValues() map[string]interface{}

func (*Configurator) GetValueByString

func (c *Configurator) GetValueByString(key string) string

func (*Configurator) Path

func (c *Configurator) Path() string

func (*Configurator) Save

func (c *Configurator) Save(config *types.Config) error

func (*Configurator) SetValueByString

func (c *Configurator) SetValueByString(key string, value string) error

type Option

type Option func(*Options)

func WithApplication

func WithApplication(name string, extenstion string) Option

func WithLocation

func WithLocation(path string) Option

func WithLogger

func WithLogger(logger types.Logger) Option

func WithValidator

func WithValidator(validator types.Validator) Option

type Options

type Options struct {
	Logger    types.Logger
	Validator types.Validator
	Path      string
	Name      string
	Extension string
}

Jump to

Keyboard shortcuts

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