config

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

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

func New

func New() *Config

func (*Config) GetObj

func (c *Config) GetObj(key string) interface{}

func (*Config) Register

func (c *Config) Register(reg *Register) error

func (*Config) SetRemote

func (c *Config) SetRemote(namespaceId string, nodes []*RemoteNode) error

func (*Config) UnitsAdd

func (c *Config) UnitsAdd(us ...*Unit)

func (*Config) UnitsEqual

func (c *Config) UnitsEqual(a, b *Unit) bool

func (*Config) UnitsExist

func (c *Config) UnitsExist(unit *Unit, equal func(a, b *Unit) bool) bool

func (*Config) UnitsGet

func (c *Config) UnitsGet(key string) *Unit

func (*Config) UnitsRange

func (c *Config) UnitsRange(fn func(u *Unit) bool)

type Layout

type Layout int
const (
	LayoutYaml Layout = iota
	LayoutJson
	LayoutToml
	LayoutIni
)

type Register

type Register struct {
	Key       string
	Name      string
	Path      string
	Obj       interface{}
	Layout    Layout
	LoadLocal bool
	Center    *RegisterCenter
}

type RegisterCenter

type RegisterCenter struct {
	GroupId    string
	DataId     string
	UpdateHook func(obj interface{})
}

type RemoteNode

type RemoteNode struct {
	Addr string
	Port uint16
}

type Unit

type Unit struct {
	Layout layout.Layout
	// contains filtered or unexported fields
}

func (*Unit) LoadLocal

func (u *Unit) LoadLocal() error

func (*Unit) Update

func (u *Unit) Update(data []byte) error

func (*Unit) UpdateObj

func (u *Unit) UpdateObj(data []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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