config

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchPropertyFromContext added in v1.0.0

func FetchPropertyFromContext(ctx context.Context, property string) (interface{}, error)

FetchPropertyFromContext is a helper function to retrieve a specific config property from the Config store in ctx, rather than retrieving the entire Config object.

func StoreInContext added in v1.0.0

func StoreInContext(ctx context.Context, c Config) context.Context

StoreInContext returns a new Context that stores the Config, c.

Types

type Config added in v1.0.0

type Config interface {
	Get(string) (interface{}, error)
	Set(string, interface{}) error
	Validate() error
	Refresh(context.Context) error
	Upgrade() error
}

func FetchFromContext added in v1.0.0

func FetchFromContext(ctx context.Context) (Config, error)

FetchFromContext returns the Config value stored in ctx, if any.

type MockConfig added in v1.4.3

type MockConfig struct {
	mock.Mock
}

MockConfig is an autogenerated mock type for the Config type

func NewMockConfig added in v1.4.3

func NewMockConfig(t interface {
	mock.TestingT
	Cleanup(func())
}) *MockConfig

NewMockConfig creates a new instance of MockConfig. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.

func (*MockConfig) Get added in v1.4.3

func (_m *MockConfig) Get(_a0 string) (interface{}, error)

Get provides a mock function with given fields: _a0

func (*MockConfig) Refresh added in v1.4.3

func (_m *MockConfig) Refresh(_a0 context.Context) error

Refresh provides a mock function with given fields: _a0

func (*MockConfig) Set added in v1.4.3

func (_m *MockConfig) Set(_a0 string, _a1 interface{}) error

Set provides a mock function with given fields: _a0, _a1

func (*MockConfig) Upgrade added in v1.4.3

func (_m *MockConfig) Upgrade() error

Upgrade provides a mock function with given fields:

func (*MockConfig) Validate added in v1.4.3

func (_m *MockConfig) Validate() error

Validate provides a mock function with given fields:

Jump to

Keyboard shortcuts

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