dynconfig

package
v2.0.7-alpha.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CacheDirName is dir name of dynconfig cache.
	CacheDirName = "dynconfig"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DecoderConfigOption

type DecoderConfigOption func(*mapstructure.DecoderConfig)

A DecoderConfigOption can be passed to dynconfig Unmarshal to configure mapstructure.DecoderConfig options.

type Dynconfig

type Dynconfig interface {
	// Unmarshal unmarshals the config into a Struct. Make sure that the tags
	// on the fields of the structure are properly set.
	Unmarshal(rawVal any) error

	// Refresh refreshes dynconfig in cache.
	Refresh() error
}

func New

func New(client ManagerClient, cachePath string, expire time.Duration) (Dynconfig, error)

New returns a new dynconfig instance.

type ManagerClient

type ManagerClient interface {
	Get() (any, error)
}

managerClient is a client of manager.

type SourceType

type SourceType string

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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