config

package
v3.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(opt *option.Options) error

Init init config

func Parse

func Parse(rd io.Reader) error

Parse parse config from reader

func ParseFromBytes

func ParseFromBytes(data []byte) error

ParseFromBytes parse config from data

func ParseFromFile

func ParseFromFile(path string) error

ParseFromFile parse config from file

Types

type ConfCenter

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

ConfCenter discover configure changed. get, update configures

func NewConfCenter

func NewConfCenter(serv string) *ConfCenter

NewConfCenter create a ConfCenter object

func (*ConfCenter) GetConfigureCxt

func (cc *ConfCenter) GetConfigureCxt() []byte

GetConfigureCtx fetch the configure

func (*ConfCenter) Ping

func (cc *ConfCenter) Ping() error

Ping to ping server

func (*ConfCenter) Start

func (cc *ConfCenter) Start() error

Start the configure center module service

func (*ConfCenter) Stop

func (cc *ConfCenter) Stop() error

Stop the configure center

type Config

type Config map[string]string

Config define config type

func Get

func Get() Config

Get returns the parsed config

func (Config) Get

func (c Config) Get(key string) string

Jump to

Keyboard shortcuts

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