data

package
v0.0.0-...-96b211d Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheClient

type CacheClient interface {
	Del(keys ...string) error
	HSet(key string, field string, value string) error
	HGet(key string, field string) (*string, error)
	HDel(key string, fields ...string) error
	HGetAll(key string) (map[string]string, error)
	HMSet(key string, values map[string]string) error
	Pipeline(commands []radix.CmdAction) error

	Get(key string) (*string, error)
	Set(key string, value string) error

	Do(cmd radix.CmdAction) error
}

func NewCacheClusterClient

func NewCacheClusterClient(addresses []string, password string, timeout uint64) (CacheClient, error)

func NewCacheStandaloneClient

func NewCacheStandaloneClient(address string, password string, timeout uint64) (CacheClient, error)

type Clusters

type Clusters interface {
	RegisterCluster(cluster *common.Cluster) error
	UnregisterCluster(clusterId string, clusterHandler func(cluster *common.Cluster) error) error

	RegisterNodeTo(clusterId string, node *common.Node) error
	UnregisterNode(nodeId string, syncHandler func(cluster *common.Cluster) error, unregisteredNodeHandler func(deletingNode *common.Node) error, masterChangedHandler func(newMaster *common.Node) error) error

	Get(clusterId string) (*common.Cluster, error)
	GetByNodeId(nodeId string) (*common.Cluster, error)
	GetAll() (common.Clusters, error)

	Save(clusterId string, saveHandler func(cluster *common.Cluster) error) error
	SaveAll(saveAllHandler func(clusters common.Clusters) error) error

	SetNewMaster(clusterId string, nodeId string) error
	UpdateMaintain(clusterId string, maintain bool, topic common.Topics) error
	UpdateState(clusterId string, state common.States) error
	UpdateStateWithMaintain(clusterId string, state common.States, maintain bool, topic common.Topics) error
	UpdateNodes(cluster *common.Cluster) error
	ResetStats(cluster *common.Cluster) error
}

func NewClusters

func NewClusters(conn *Connection, database string, mutex mutex.LockingCenter) (Clusters, error)

type Connection

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

func NewConnection

func NewConnection(connectionString string, transaction bool) (*Connection, error)

type Index

type Index interface {
	WaitQueueCompletion()

	QueueUpsert(item *common.CacheFileItem, syncTime *time.Time)
	QueueDrop(clusterId string, sha512Hex string)
	QueueUpsertChunkNode(sha512Hex string, nodeId string)
	QueueUpsertUsageInMap(clusterId string, items common.SyncFileItemList)

	Get(sha512Hex string) (*common.CacheFileItem, error)

	PullMap(clusterId string) (map[string]string, error)
	CompareMap(clusterId string, items common.SyncFileItemMap) bool
}

func NewIndex

func NewIndex(client CacheClient, keyPrefix string, logger *zap.Logger) Index

type Metadata

type Metadata interface {
	Cursor(folderHandler func(folder *common.Folder) (bool, error), parallelSize uint8) error
	LockTree(folderHandler func(folders []*common.Folder) ([]*common.Folder, error)) error

	Lock()
	Unlock()
}

func NewMetadata

func NewMetadata(mutex mutex.LockingCenter, conn *Connection, database string) (Metadata, error)

type Operation

type Operation interface {
	RepairDetail() (RepairDetail, error)
	SetRepairing(repairing bool, completed bool) error
}

func NewOperation

func NewOperation(client CacheClient, keyPrefix string) Operation

type RepairDetail

type RepairDetail struct {
	Processing bool
	Timestamp  *time.Time
}

Jump to

Keyboard shortcuts

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