mconfig

package
v0.0.0-...-4ad5d62 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default_Retry_Time ...
	Default_Retry_Time = 5 * time.Second
	// Default_NameSpace ...
	Default_NameSpace = "com.github.mhchlib"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	AdapterMconfigMergeToViper(viperArr ...*viper.Viper) error
}

Adapter ...

type AdapterCallBack

type AdapterCallBack func(key string, value interface{})

AdapterCallBack ...

type AdapterCallBacks

type AdapterCallBacks struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

AdapterCallBacks ...

func (*AdapterCallBacks) Add

func (c *AdapterCallBacks) Add(callback AdapterCallBack)

Add ...

type Config

type Config interface {
	//base
	String(key string, defaultV ...string) string
	Int64(key string, defaultV ...int64) int64
	Bool(key string, defaultV ...bool) bool
	Map(key string, defaultV ...map[string]interface{}) map[string]interface{}
	SliceList(key string, defaultV ...[]interface{}) []interface{}
	Interface(key string, defaultV interface{}) interface{}
}

Config ...

type ConfigCache

type ConfigCache struct {
	Cache map[string]*FieldInterface
	sync.RWMutex
}

ConfigCache ...

type ConfigChangeCallBack

type ConfigChangeCallBack func(key string, value interface{})

ConfigChangeCallBack ...

type ConfigWatch

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

ConfigWatch ...

type ConfigWatchMap

type ConfigWatchMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ConfigWatchMap ...

func (*ConfigWatchMap) AddConfigChangeCallBack

func (c *ConfigWatchMap) AddConfigChangeCallBack(key string, val interface{}, callback ConfigChangeCallBack)

AddConfigChangeCallBack ...

type FieldInterface

type FieldInterface interface {
	// contains filtered or unexported methods
}

FieldInterface ...

type FieldInterface_Bool

type FieldInterface_Bool struct {
	Value bool
}

FieldInterface_Bool ...

type FieldInterface_Int

type FieldInterface_Int struct {
	Value int64
}

FieldInterface_Int ...

type FieldInterface_Interface

type FieldInterface_Interface struct {
	Value interface{}
}

FieldInterface_Interface ...

type FieldInterface_List

type FieldInterface_List struct {
	Value []interface{}
}

FieldInterface_List ...

type FieldInterface_Map

type FieldInterface_Map struct {
	Value map[string]interface{}
}

FieldInterface_Map ...

type FieldInterface_String

type FieldInterface_String struct {
	Value string
}

FieldInterface_String ...

type FieldType

type FieldType int

FieldType ...

const (
	// FieldType_String ...
	FieldType_String FieldType = iota
	// FieldType_Int ...
	FieldType_Int
	// FieldType_Bool ...
	FieldType_Bool
	// FieldType_Map ...
	FieldType_Map
	// FieldType_List ...
	FieldType_List
	// FieldType_Interface ...
	FieldType_Interface
)

type MconfigClient

type MconfigClient interface {
	Config
	Adapter
	WatchChange
}

MconfigClient ...

func NewClient

func NewClient(opts ...Option) MconfigClient

NewClient ...

type MconfigClientV1

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

MconfigClientV1 ...

func (*MconfigClientV1) AdapterMconfigMergeToViper

func (m *MconfigClientV1) AdapterMconfigMergeToViper(viperArr ...*viper.Viper) error

AdapterMconfigMergeToViper ...

func (*MconfigClientV1) Bool

func (m *MconfigClientV1) Bool(key string, defaultVs ...bool) bool

Bool ...

func (*MconfigClientV1) Int64

func (m *MconfigClientV1) Int64(key string, defaultVs ...int64) int64

Int64 ...

func (*MconfigClientV1) Interface

func (m *MconfigClientV1) Interface(key string, defaultV interface{}) interface{}

Interface ...

func (*MconfigClientV1) Map

func (m *MconfigClientV1) Map(key string, defaultVs ...map[string]interface{}) map[string]interface{}

Map ...

func (*MconfigClientV1) OnWatchConfigChange

func (m *MconfigClientV1) OnWatchConfigChange(key string, f ConfigChangeCallBack)

OnWatchConfigChange ...

func (*MconfigClientV1) SliceList

func (m *MconfigClientV1) SliceList(key string, defaultVs ...[]interface{}) []interface{}

SliceList ...

func (*MconfigClientV1) String

func (m *MconfigClientV1) String(key string, defaultVs ...string) string

String ...

type Option

type Option func(*Options)

Option ...

func AppKey

func AppKey(appKey string) Option

AppKey ...

func ConfigKey

func ConfigKey(keys ...string) Option

ConfigKey ...

func DirectLinkAddress

func DirectLinkAddress(address string) Option

DirectLinkAddress ...

func EnvKey

func EnvKey(envKey string) Option

EnvKey ...

func Logger

func Logger(log log.Logger) Option

Logger ...

func Metadata

func Metadata(key string, value string) Option

Metadata ...

func NameSpace

func NameSpace(namespace string) Option

NameSpace ...

func Registry

func Registry(registerUrl string) Option

Registry ...

func RetryIntervalTime

func RetryIntervalTime(t time.Duration) Option

RetryIntervalTime ...

type Options

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

Options ...

func NewOptions

func NewOptions() *Options

NewOptions ...

type OriginConfigCache

type OriginConfigCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

OriginConfigCache ...

func (OriginConfigCache) Put

func (originConfigCache OriginConfigCache) Put(key string, value string)

Put ...

type Register_Type

type Register_Type string

Register_Type ...

var (
	// RegisterType_Etcd ...
	RegisterType_Etcd Register_Type = "etcd"
)

type WatchChange

type WatchChange interface {
	OnWatchConfigChange(key string, f ConfigChangeCallBack)
}

WatchChange ...

Jump to

Keyboard shortcuts

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