replicas

package
v0.0.106 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Default

func Default(replicasNumber uint64, existingIndexes []uint64) ([]uint64, []uint64, []uint64)

func Empty added in v0.0.93

func Empty() ([]uint64, []uint64, []uint64)

func Specific

func Specific(replicasNumber uint64, existingIndexes []uint64, nodes []uint64, member uint64) ([]uint64, []uint64, []uint64)

func Uniform

func Uniform(replicasNumber uint64, existingIndexes []uint64, clusterSize uint64, member uint64) ([]uint64, []uint64, []uint64)

Types

type Distributed added in v0.0.81

type Distributed struct {
	Group    string
	Name     string
	Spread   string
	Replicas map[uint64]*ScopedReplicas
}

func NewDistributed

func NewDistributed(nodeID uint64, group string, name string) *Distributed

func (*Distributed) Clear added in v0.0.81

func (dr *Distributed) Clear(node uint64)

func (*Distributed) FromJson added in v0.0.81

func (dr *Distributed) FromJson(data []byte) error

func (*Distributed) Load added in v0.0.81

func (dr *Distributed) Load(client *client.Client, user *authentication.User) error

func (*Distributed) Remove added in v0.0.81

func (dr *Distributed) Remove(client *client.Client, user *authentication.User) (bool, error)

func (*Distributed) Save added in v0.0.81

func (dr *Distributed) Save(client *client.Client, user *authentication.User) error

func (*Distributed) ToJson added in v0.0.81

func (dr *Distributed) ToJson() ([]byte, error)

type Numbers

type Numbers struct {
	Create   []uint64
	Destroy  []uint64
	Existing []uint64
}

type R

type R struct {
	Group string
	Name  string
}

type Replicas

type Replicas struct {
	NodeID          uint64
	Definition      *v1.ContainerDefinition
	Shared          *shared.Shared
	Distributed     *Distributed
	Agent           string
	ChangeLog       diff.Changelog
	Spread          v1.ContainerSpread
	ExistingIndexes []uint64
}

func NewReplica added in v0.0.81

func NewReplica(shared *shared.Shared, agent string, definition *v1.ContainerDefinition, changelog diff.Changelog) *Replicas

func (*Replicas) GetReplica

func (replicas *Replicas) GetReplica(user *authentication.User, clstr []string) (*Distributed, error)

func (*Replicas) GetReplicaNumbers

func (replicas *Replicas) GetReplicaNumbers(dr *Distributed, spread v1.ContainerSpread, replicasNumber uint64, existingIndexes []uint64, clusterSize uint64) ([]uint64, []uint64, []uint64)

func (*Replicas) HandleReplica

func (replicas *Replicas) HandleReplica(user *authentication.User, clstr []string) (*Distributed, error)

type ScopedReplicas

type ScopedReplicas struct {
	Create   []R
	Remove   []R
	Existing []R
	Numbers  Numbers
}

func NewScoped

func NewScoped() *ScopedReplicas

func (*ScopedReplicas) Add

func (sr *ScopedReplicas) Add(group string, name string)

func (*ScopedReplicas) AddExisting added in v0.0.81

func (sr *ScopedReplicas) AddExisting(group string, name string)

func (*ScopedReplicas) Delete

func (sr *ScopedReplicas) Delete(group string, name string)

Jump to

Keyboard shortcuts

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