Documentation ¶
Index ¶
- func Default(replicasNumber uint64, existingIndexes []uint64) ([]uint64, []uint64, []uint64)
- func Empty() ([]uint64, []uint64, []uint64)
- func Specific(replicasNumber uint64, existingIndexes []uint64, nodes []uint64, member uint64) ([]uint64, []uint64, []uint64)
- func Uniform(replicasNumber uint64, existingIndexes []uint64, clusterSize uint64, ...) ([]uint64, []uint64, []uint64)
- type Distributed
- func (dr *Distributed) Clear(node uint64)
- func (dr *Distributed) FromJson(data []byte) error
- func (dr *Distributed) Load(client *client.Client, user *authentication.User) error
- func (dr *Distributed) Remove(client *client.Client, user *authentication.User) (bool, error)
- func (dr *Distributed) Save(client *client.Client, user *authentication.User) error
- func (dr *Distributed) ToJson() ([]byte, error)
- type Numbers
- type R
- type Replicas
- func (replicas *Replicas) GetReplica(user *authentication.User, clstr []string) (*Distributed, error)
- func (replicas *Replicas) GetReplicaNumbers(dr *Distributed, spread v1.ContainerSpread, replicasNumber uint64, ...) ([]uint64, []uint64, []uint64)
- func (replicas *Replicas) HandleReplica(user *authentication.User, clstr []string) (*Distributed, error)
- type ScopedReplicas
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 Replicas ¶
type Replicas struct { NodeID uint64 Definition *v1.ContainerDefinition Distributed *Distributed Agent string ChangeLog diff.Changelog Spread v1.ContainerSpread ExistingIndexes []uint64 }
func NewReplica ¶ added in v0.0.81
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 ¶
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)
Click to show internal directories.
Click to hide internal directories.