configer

package
v2.0.0+incompatible Latest Latest
Warning

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

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

README

configer

package configer is a configuration center that uses etcd as a storage medium.

Server command: configer

Documentation

Index

Constants

View Source
const (
	// KEY_PREFIX the prifix of config data key in etcd
	KEY_PREFIX = "MICRO-CONF"
)

Variables

This section is empty.

Functions

func InitMgr

func InitMgr(etcdClient *etcd.Client)

InitMgr initializes a config manager.

func InitNode

func InitNode(etcdClient *etcd.Client)

InitNode initializes the config node.

func NewEtcdClientFromYaml

func NewEtcdClientFromYaml() (*etcd.Client, error)

NewEtcdClientFromYaml uses config/etcd.yaml to create a etcd client.

func NewKey

func NewKey(service string, version string) string

NewKey creates a config data key Note: service and version can not contant "@"!

func PullCtrl

func PullCtrl() interface{}

PullCtrl returns a new PULL controller.

func SyncNode

func SyncNode(service, version string, cfg Config)

SyncNode registers a configuration template to etcd, and update it when monitoring the configuration changes.

Types

type Config

type Config interface {
	UnmarshalJSON([]byte) error
	MarshalJSON() ([]byte, error)
	Reload([]byte) error
}

Config config interface

type ConfigKV

type ConfigKV struct {
	Key   string
	Value string
}

ConfigKV config key-value data.

type Node

type Node struct {

	// Config string
	Config string `json:"config"`
	// Is it initialized?
	Initialized bool `json:"initialized"`
	// contains filtered or unexported fields
}

Node config node handler

func (*Node) String

func (n *Node) String() string

String returns the encoding string

type Nodes

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

Nodes config node handlers

Jump to

Keyboard shortcuts

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