storage

package
v0.0.0-...-d989b54 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventChanSize = 10000
)

Variables

This section is empty.

Functions

func InitStorage

func InitStorage(storgaeUrl []string, storageUsername, storagePassword string, mode operate.EventModeType, logger *logger.Logger) error

Types

type Storage

type Storage interface {
	SetKey(domain, file, section, key, value, note string) error
	GetKey(domain, file, section, key string, withLock bool) (string, error)
	DelKey(domain, file, section, key, note string) error

	AddFile(domain, file string, data map[string]map[string]string, note string) error
	DelFile(domain, file, note string) error

	SetDomain(domain string, data map[string]map[string]map[string]string, note string) error
	GetDomain(domain string, withLock bool) (map[string]map[string]map[string]string, error)
	DelDomain(domain string, note string) error

	GetDomainNames(withLock bool) ([]string, error)

	Rollback(domain string, version int64, note string) error

	SetCurrentVersion(domain string, version int64) error
	GetCurrentVersion(domain string, withLock bool) (int64, error)
	GetMaxVersion(domain string, withLock bool) (int64, error)
	GetHistoryVersions(domain string, num, offset int64, withLock bool) (interface{}, error)

	SetKeeperAddr(domain, nodeID, addr string) error
	GetKeeperAddr(domain, nodeID string, withLock bool) (string, error)
	GetKeeperAddrs(domain string, withLock bool) ([]string, error)
	DelKeeperAddr(domain, nodeID, preValue string) error

	//keeper addr 续租
	KeepAlive(id int64, addr string)
	GetAliveKeeperNodes(withLock bool) (map[int64]string, error)

	Watch(operate.EventModeType, chan<- operate.Event)
}
var (
	KStorage  Storage
	EventChan chan operate.Event
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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