archaius

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDI

func AddDI(dimensionInfo string) (map[string]string, error)

AddDI adds a NewDimensionInfo of which configurations needs to be taken

func AddFile

func AddFile(file string) error

AddFile is for to add the configuration files into the configfactory at run time

func AddKeyValue

func AddKeyValue(key string, value interface{}) error

AddKeyValue is for to add the configuration key, value pairs into the configfactory at run time

func DeleteKeyValue

func DeleteKeyValue(key string, value interface{}) error

DeleteKeyValue is for to delete the configuration key, value pairs into the configfactory at run time

func Exist

func Exist(key string) bool

Exist is check the configuration key existence

func Get

func Get(key string) interface{}

Get is for to get the value of configuration key

func GetBool

func GetBool(key string, defaultValue bool) bool

GetBool is gives the key value in the form of bool

func GetConfigs

func GetConfigs() map[string]interface{}

GetConfigs gives the information about all configurations

func GetConfigsByDI

func GetConfigsByDI(dimensionInfo string) map[string]interface{}

GetConfigsByDI is for to get the all configurations received dimensionInfo

func GetFloat64

func GetFloat64(key string, defaultValue float64) float64

GetFloat64 gives the key value in the form of float64

func GetInt

func GetInt(key string, defaultValue int) int

GetInt gives the key value in the form of GetInt

func GetString

func GetString(key string, defaultValue string) string

GetString gives the key value in the form of GetString

func GetStringByDI

func GetStringByDI(dimensionInfo, key string, defaultValue string) string

GetStringByDI is for to get the value of configuration key based on dimension info

func Init

func Init() error

Init is to initialize the archaius

func PathExist

func PathExist(_path string) bool

PathExist to check the existence of the file path

func RegisterListener

func RegisterListener(listenerObj core.EventListener, key ...string) error

RegisterListener to Register all listener for different key changes, each key could be a regular expression

func UnRegisterListener

func UnRegisterListener(listenerObj core.EventListener, key ...string) error

UnRegisterListener is to remove the listener

func UnmarshalConfig

func UnmarshalConfig(obj interface{}) error

UnmarshalConfig is for unmarshalling the configuraions of receiving object

Types

type Config

type Config struct {
	ConfigFiles   []string
	ConfigFactory goarchaius.ConfigurationFactory
}

Config is the struct of configuration files, and configuration factory

var DefaultConf *Config

DefaultConf is the variable having information about configuration files, and configuration factory

func NewConfig

func NewConfig(essentialfiles, commonfiles []string) (*Config, error)

NewConfig is gives the object of Config(it is having configuration files, and configuration factory)

type ConfigListener

type ConfigListener struct{}

ConfigListener is provides the object to listen the events

func (*ConfigListener) Event

func (cl *ConfigListener) Event(e *core.Event)

Event is for to receive the events based on registered key and object pairs

type EventListener

type EventListener struct {
	Name    string
	Factory goarchaius.ConfigurationFactory
}

EventListener is a struct having information about registering key and object

func (EventListener) Event

func (e EventListener) Event(event *core.Event)

Event is invoked while generating events at run time

Jump to

Keyboard shortcuts

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