config

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

github.com/whatap/golib/config

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	ApplyDefault()
	GetConfFile() string
	Destroy()
	GetKeys() []string
	GetValue(key string) string
	GetValueDef(key, def string) string
	GetBoolean(key string, def bool) bool
	GetInt(key string, def int) int32
	GetIntSet(key, def, deli string) []int32
	GetLong(key string, def int64) int64
	GetStringArray(key string, def string, deli string) []string
	GetStringHashSet(key, def, deli string) []int32
	GetStringHashCodeSet(key, def, deli string) []int32
	GetFloat(key string, def float32) float32
	SetValues(v *map[string]string)
	ToString() string
	String() string
}

type ConfigObserver

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

func GetConfigObserver

func GetConfigObserver() *ConfigObserver

func NewConfigObserver

func NewConfigObserver() *ConfigObserver

func (*ConfigObserver) Add

func (this *ConfigObserver) Add(cls string, conf Configure)

func (*ConfigObserver) Run

func (this *ConfigObserver) Run(conf Config)

type Configure

type Configure interface {
	ApplyConfig(conf Config)
}

type MockConfig added in v0.0.15

type MockConfig struct {
	mock.Mock
}

MockConfig is an autogenerated mock type for the Config type

func NewMockConfig added in v0.0.15

func NewMockConfig(t mockConstructorTestingTNewMockConfig) *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.

func (*MockConfig) ApplyDefault added in v0.0.15

func (_m *MockConfig) ApplyDefault()

ApplyDefault provides a mock function with given fields:

func (*MockConfig) Destroy added in v0.0.15

func (_m *MockConfig) Destroy()

func (*MockConfig) GetBoolean added in v0.0.15

func (_m *MockConfig) GetBoolean(key string, def bool) bool

GetBoolean provides a mock function with given fields: key, def

func (*MockConfig) GetConfFile added in v0.0.15

func (_m *MockConfig) GetConfFile() string

func (*MockConfig) GetFloat added in v0.0.15

func (_m *MockConfig) GetFloat(key string, def float32) float32

GetFloat provides a mock function with given fields: key, def

func (*MockConfig) GetInt added in v0.0.15

func (_m *MockConfig) GetInt(key string, def int) int32

GetInt provides a mock function with given fields: key, def

func (*MockConfig) GetIntSet added in v0.0.15

func (_m *MockConfig) GetIntSet(key string, def string, deli string) []int32

GetIntSet provides a mock function with given fields: key, def, deli

func (*MockConfig) GetKeys added in v0.0.15

func (_m *MockConfig) GetKeys() []string

func (*MockConfig) GetLong added in v0.0.15

func (_m *MockConfig) GetLong(key string, def int64) int64

GetLong provides a mock function with given fields: key, def

func (*MockConfig) GetStringArray added in v0.0.15

func (_m *MockConfig) GetStringArray(key string, def string, deli string) []string

GetStringArray provides a mock function with given fields: key, def, deli

func (*MockConfig) GetStringHashCodeSet added in v0.0.15

func (_m *MockConfig) GetStringHashCodeSet(key string, def string, deli string) []int32

GetStringHashCodeSet provides a mock function with given fields: key, def, deli

func (*MockConfig) GetStringHashSet added in v0.0.15

func (_m *MockConfig) GetStringHashSet(key string, def string, deli string) []int32

GetStringHashSet provides a mock function with given fields: key, def, deli

func (*MockConfig) GetValue added in v0.0.15

func (_m *MockConfig) GetValue(key string) string

GetValue provides a mock function with given fields: key

func (*MockConfig) GetValueDef added in v0.0.15

func (_m *MockConfig) GetValueDef(key string, def string) string

GetValueDef provides a mock function with given fields: key, def

func (*MockConfig) SetValues added in v0.0.15

func (_m *MockConfig) SetValues(v *map[string]string)

SetValues provides a mock function with given fields: v

func (*MockConfig) String added in v0.0.15

func (_m *MockConfig) String() string

String provides a mock function with given fields:

func (*MockConfig) ToString added in v0.0.15

func (_m *MockConfig) ToString() string

ToString provides a mock function with given fields:

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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