peer

package
v0.0.0-...-cd0f3b4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2016 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package peer implements the Peer type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddOrUpdatePeer

func AddOrUpdatePeer(p *Peer) error

AddOrUpdatePeer adds/updates given peer in the store

func AddSelfDetails

func AddSelfDetails()

AddSelfDetails function adds its own details into the central store

func DeletePeer

func DeletePeer(id string) error

DeletePeer deletes given peer from the store

func Exists

func Exists(id string) bool

Exists checks if given peer is present in the store

func GetInitialCluster

func GetInitialCluster() (string, error)

GetInitialCluster() form and returns the etcd initial cluster value in a string

Types

type ETCDConfig

type ETCDConfig struct {
	PeerName       string
	Name           string
	InitialCluster string
	ClusterState   string
	Client         bool
}

ETCDConfig represents the structure which holds the ETCD env variables & other configurations to be used to set at the remote peer & bring up the etcd instance

type Peer

type Peer struct {
	ID        uuid.UUID `json:"id"`
	Name      string    `json:"name"`
	Addresses []string  `json:"addresses"`
	Client    bool      `json:"client"`
	MemberID  string    `json:"memberID"`
}

Peer reperesents a GlusterD

func GetPeer

func GetPeer(id string) (*Peer, error)

GetPeer returns specified peer from the store

func GetPeerByName

func GetPeerByName(name string) (*Peer, error)

GetPeerByName returns the peer with the given name from store

func GetPeers

func GetPeers() ([]Peer, error)

GetPeers returns all available peers in the store

type PeerAddRequest

type PeerAddRequest struct {
	Addresses []string `json:"addresses"`
	Name      string   `json:"name,omitempty"`
	Client    bool     `json:"client,omitempty"`
}

PeerAddRequest represents the structure to be added into the store

Jump to

Keyboard shortcuts

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