database

package
v0.0.0-...-2d94127 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPathExists

func CheckPathExists(path string) error

func DeleteParts

func DeleteParts(conf Config) error

func InitialiseParts

func InitialiseParts(conf Config) error

func RebalancePartition

func RebalancePartition(oldPartition Partition) error

func RenamePartition

func RenamePartition(fromPartition Partition, toPartition Partition) error

func TransferPartitionData

func TransferPartitionData(fromPartition Partition, toPartition Partition) error

Types

type Config

type Config struct {
	PartCount int           `yaml:"partCount"`
	PartsMap  map[int]Parts `yaml:"parts"`
}

type Partition

type Partition struct {
	Name         string
	PartitionLoc string
	Conf         Config
}

func CollectPartition

func CollectPartition(partitionName string) (Partition, error)

func InitPartition

func InitPartition(name string, loc string) Partition

func (Partition) CheckPartLocExists

func (partition Partition) CheckPartLocExists() error

func (*Partition) CreatePartition

func (partition *Partition) CreatePartition() error

func (*Partition) CreateTemplate

func (partition *Partition) CreateTemplate(n int) error

func (Partition) DeleteOne

func (partition Partition) DeleteOne(unhashedKey string) error

func (Partition) DeletePartition

func (partition Partition) DeletePartition() error

func (Partition) GetAll

func (partition Partition) GetAll()

func (Partition) GetOne

func (partition Partition) GetOne(unhashedKey string) (string, error)

func (*Partition) InitialiseConfig

func (partition *Partition) InitialiseConfig(n int) error

func (Partition) InsertOne

func (partition Partition) InsertOne(unhashedKey string, value string) error

func (*Partition) LoadConfig

func (partition *Partition) LoadConfig(confName string) error

func (*Partition) RenameInternalParts

func (partition *Partition) RenameInternalParts(toName string) error

func (Partition) WriteConfig

func (partition Partition) WriteConfig() error

type Parts

type Parts struct {
	PartLoc string `yaml:"loc"`
	Link    int    `yaml:"link"` // 0 - file, 1 - rpc
}

Jump to

Keyboard shortcuts

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