configmgr

package
v0.0.0-...-303e327 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OperTypeSetConfig = iota + 1
	OperTypeDeleteConfig
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMgr

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

func New

func New(kvMgr kvmgr.KvMgrAPI, clusterConfig map[string]interface{}) (*ConfigMgr, error)

func (*ConfigMgr) Apply

func (v *ConfigMgr) Apply(ctx context.Context, operTypes []int32, datas [][]byte, contexts []base.ProposeContext) (err error)

func (*ConfigMgr) Delete

func (c *ConfigMgr) Delete(ctx context.Context, key string) (err error)

func (*ConfigMgr) Flush

func (v *ConfigMgr) Flush(ctx context.Context) error

Flush will flush memory data into persistent storage

func (*ConfigMgr) Get

func (c *ConfigMgr) Get(ctx context.Context, key string) (val string, err error)

func (*ConfigMgr) GetModuleName

func (v *ConfigMgr) GetModuleName() string

func (*ConfigMgr) LoadData

func (s *ConfigMgr) LoadData(ctx context.Context) error

func (*ConfigMgr) NotifyLeaderChange

func (v *ConfigMgr) NotifyLeaderChange(ctx context.Context, leader uint64, host string)

Switch manager work when leader change

func (*ConfigMgr) Set

func (c *ConfigMgr) Set(ctx context.Context, key, value string) (err error)

func (*ConfigMgr) SetModuleName

func (v *ConfigMgr) SetModuleName(module string)

func (*ConfigMgr) SetRaftServer

func (c *ConfigMgr) SetRaftServer(raftServer raftserver.RaftServer)

type ConfigMgrAPI

type ConfigMgrAPI interface {
	Get(ctx context.Context, key string) (val string, err error)
	Set(ctx context.Context, key string, value string) (err error)
	Delete(ctx context.Context, key string) (err error)
}

Jump to

Keyboard shortcuts

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