Documentation ¶
Index ¶
- type Membership
- func (m *Membership) GetNodeState(nn string) (*State, error)
- func (m *Membership) GetNodeWithVolumeByID(vid string) (*client.Client, error)
- func (m *Membership) Leave()
- func (m *Membership) LocalVolumes() []volume.Local
- func (m *Membership) Nodes() (res []*client.Client)
- func (m *Membership) NodesWithoutVolumeIDs(vids []string) (res []*client.Client)
- func (m *Membership) RemovedVolumeIDs() []string
- type Metadata
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Membership ¶
type Membership struct {
// contains filtered or unexported fields
}
Membership handles all the logic of the Node persistence and also the localVolumes
func New ¶
func New(cfg *config.Config, lv []volume.Local, remote string, logger kitlog.Logger) (*Membership, error)
New returns an implementation of the Membership interface
func (*Membership) GetNodeState ¶ added in v0.3.0
func (m *Membership) GetNodeState(nn string) (*State, error)
GetNodeState returns the volume State
func (*Membership) GetNodeWithVolumeByID ¶
func (m *Membership) GetNodeWithVolumeByID(vid string) (*client.Client, error)
GetNodeWithVolumeByID returns the Node/client.Client that has the gicen vid
func (*Membership) LocalVolumes ¶
func (m *Membership) LocalVolumes() []volume.Local
LocalVolumes returns all the local volumes
func (*Membership) Nodes ¶
func (m *Membership) Nodes() (res []*client.Client)
Nodes return all the nodes of the Cluster
func (*Membership) NodesWithoutVolumeIDs ¶ added in v0.3.0
func (m *Membership) NodesWithoutVolumeIDs(vids []string) (res []*client.Client)
NodesWithoutVolumeIDs return all the nodes of the Cluster
func (*Membership) RemovedVolumeIDs ¶
func (m *Membership) RemovedVolumeIDs() []string
RemovedVolumeIDs returns the list of removed VolumeIDs from the cluster. WARNING: Each call to it empties the list so the list of nodes have to be stored/used once called
type Metadata ¶ added in v0.3.0
type Metadata struct { // Port is the port in which the storing.Service is // raised, needed to connect to the client Port int `json:"port"` // Volumes list of all VolumeIDs of the Node Volumes map[string]struct{} `json:"volumes"` }
Metadata is the metadata that it's send for each node
type State ¶ added in v0.3.0
type State struct { // Node is the name of the Node Node string `json:"node"` // Volumes is the list of volumes of the Node with the State // each one have Volumes map[string]state.State `json:"volume_ids"` }
State holds the node state which will be notified to the other Nodes