sources

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvSource

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

EnvSource represents.

func NewEnvSource

func NewEnvSource(priority int, envs []string) *EnvSource

NewEnvSource.

func (*EnvSource) Close

func (s *EnvSource) Close(ctx context.Context)

Close.

func (*EnvSource) ID

func (s *EnvSource) ID() string

ID.

func (*EnvSource) Load

func (s *EnvSource) Load(ctx context.Context, services []string) error

Load.

func (*EnvSource) Priority

func (s *EnvSource) Priority() int

Priority.

func (*EnvSource) ServiceConfig

func (s *EnvSource) ServiceConfig(serviceName string) (conf.Config, error)

ServiceConfig.

type FlagsSource

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

FlagsSource represents.

func NewFlagsSource

func NewFlagsSource(priority int, prefix string) *FlagsSource

NewFlagsSource initializes FlagsSource using standard `os.Args`.

func (*FlagsSource) Close

func (s *FlagsSource) Close(ctx context.Context)

Close.

func (*FlagsSource) ID

func (s *FlagsSource) ID() string

ID.

func (*FlagsSource) Load

func (s *FlagsSource) Load(ctx context.Context, services []string) (err error)

Load loads configuration data from flags passed at args.

func (*FlagsSource) Priority

func (s *FlagsSource) Priority() int

Priority.

func (*FlagsSource) ServiceConfig

func (s *FlagsSource) ServiceConfig(serviceName string) (conf.Config, error)

ServiceConfig.

type JSONSource

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

JSONFileStorage represents.

func NewJSONSource

func NewJSONSource(priority int, src io.ReadCloser) *JSONSource

NewJSONSource

func (*JSONSource) Close

func (s *JSONSource) Close(ctx context.Context)

Close

func (*JSONSource) ID

func (s *JSONSource) ID() string

ID

func (*JSONSource) Load

func (s *JSONSource) Load(ctx context.Context, services []string) error

Load

func (*JSONSource) Priority

func (s *JSONSource) Priority() int

Priority

func (*JSONSource) ServiceConfig

func (s *JSONSource) ServiceConfig(serviceName string) (conf.Config, error)

ServiceConfig

func (*JSONSource) SetJSONUnmarshaler

func (s *JSONSource) SetJSONUnmarshaler(u JSONUnmarshaler)

SetJSONUnmarshaler

func (*JSONSource) SetReader

func (s *JSONSource) SetReader(r SrcReader)

SetReader

type JSONUnmarshaler

type JSONUnmarshaler func([]byte, interface{}) error

JSONUnmarshaler

type MapSource

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

MapSource represents.

func NewMapSource

func NewMapSource(priority int, data map[string]conf.Config) *MapSource

NewMapSource.

func (*MapSource) Close

func (s *MapSource) Close(ctx context.Context)

Close.

func (*MapSource) ID

func (s *MapSource) ID() string

ID returns unique source id.

func (*MapSource) Load

func (s *MapSource) Load(ctx context.Context, services []string) error

Load.

func (*MapSource) Priority

func (s *MapSource) Priority() int

Priority.

func (*MapSource) ServiceConfig

func (s *MapSource) ServiceConfig(serviceName string) (conf.Config, error)

ServiceConfig.

type ServiceConfigError

type ServiceConfigError struct {
	ServiceName string
	SourceID    string
}

ServiceConfigError represents.

func (ServiceConfigError) Error

func (e ServiceConfigError) Error() string

Error.

type SrcReader

type SrcReader func(io.Reader) ([]byte, error)

SrcReader

Jump to

Keyboard shortcuts

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