config

package
v0.0.0-...-d766383 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: AGPL-3.0 Imports: 15 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 NewConfig

func NewConfig(cli *etcd.Client, keywords ...string) *Config

func (*Config) Delete

func (p *Config) Delete(key string) error

func (*Config) Get

func (p *Config) Get(key string) ([]byte, error)

func (*Config) GetJson

func (p *Config) GetJson(key string, value interface{}) error

func (*Config) GetPb

func (p *Config) GetPb(key string, value proto.Message) error

func (*Config) ListPrefix

func (p *Config) ListPrefix(prefix string) ([]string, error)

func (*Config) OnChanged

func (p *Config) OnChanged(logic func(item *core.ConfigItem, eventType EventType))

func (*Config) Set

func (p *Config) Set(key string, value []byte) error

func (*Config) SetJson

func (p *Config) SetJson(key string, value any) error

func (*Config) SetPb

func (p *Config) SetPb(key string, value proto.Message) error

type EventType

type EventType uint8
const (
	Changed EventType = iota + 1
	Deleted
)

Jump to

Keyboard shortcuts

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