peer

package
v0.0.0-...-4e63163 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2016 License: GPL-2.0 Imports: 6 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 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

Types

type Peer

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

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"`
}

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