peers

package
v0.0.39-rc1 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package peers is a generated protocol buffer package.

It is generated from these files:

types.proto

It has these top-level messages:

Peer
ComputeUsage
MemoryUsage
PeerList

Index

Constants

View Source
const (
	PeerCreated string = "peer_created"
	PeerUpdated string = "peer_updated"
	PeerDeleted string = "peer_deleted"
)

Variables

View Source
var (
	ErrPeerNotFound = errors.New("peer not found")
)

Functions

func IsOutdated

func IsOutdated(s *Peer, remote *Peer) (outdated bool)

Types

type ComputeUsage added in v0.0.20

type ComputeUsage struct {
	Cores      int64 `protobuf:"varint,1,opt,name=Cores" json:"Cores,omitempty"`
	Goroutines int64 `protobuf:"varint,2,opt,name=Goroutines" json:"Goroutines,omitempty"`
}

func (*ComputeUsage) Descriptor added in v0.0.20

func (*ComputeUsage) Descriptor() ([]byte, []int)

func (*ComputeUsage) GetCores added in v0.0.20

func (m *ComputeUsage) GetCores() int64

func (*ComputeUsage) GetGoroutines added in v0.0.20

func (m *ComputeUsage) GetGoroutines() int64

func (*ComputeUsage) ProtoMessage added in v0.0.20

func (*ComputeUsage) ProtoMessage()

func (*ComputeUsage) Reset added in v0.0.20

func (m *ComputeUsage) Reset()

func (*ComputeUsage) String added in v0.0.20

func (m *ComputeUsage) String() string

type MemoryUsage added in v0.0.20

type MemoryUsage struct {
	Alloc      uint64 `protobuf:"varint,1,opt,name=Alloc" json:"Alloc,omitempty"`
	TotalAlloc uint64 `protobuf:"varint,2,opt,name=TotalAlloc" json:"TotalAlloc,omitempty"`
	Sys        uint64 `protobuf:"varint,3,opt,name=Sys" json:"Sys,omitempty"`
	NumGC      uint32 `protobuf:"varint,4,opt,name=NumGC" json:"NumGC,omitempty"`
}

func (*MemoryUsage) Descriptor added in v0.0.20

func (*MemoryUsage) Descriptor() ([]byte, []int)

func (*MemoryUsage) GetAlloc added in v0.0.20

func (m *MemoryUsage) GetAlloc() uint64

func (*MemoryUsage) GetNumGC added in v0.0.20

func (m *MemoryUsage) GetNumGC() uint32

func (*MemoryUsage) GetSys added in v0.0.20

func (m *MemoryUsage) GetSys() uint64

func (*MemoryUsage) GetTotalAlloc added in v0.0.20

func (m *MemoryUsage) GetTotalAlloc() uint64

func (*MemoryUsage) ProtoMessage added in v0.0.20

func (*MemoryUsage) ProtoMessage()

func (*MemoryUsage) Reset added in v0.0.20

func (m *MemoryUsage) Reset()

func (*MemoryUsage) String added in v0.0.20

func (m *MemoryUsage) String() string

type Peer

type Peer struct {
	ID           string        `protobuf:"bytes,1,opt,name=ID" json:"ID,omitempty"`
	MeshID       string        `protobuf:"bytes,2,opt,name=MeshID" json:"MeshID,omitempty"`
	Hostname     string        `protobuf:"bytes,3,opt,name=Hostname" json:"Hostname,omitempty"`
	Address      string        `protobuf:"bytes,4,opt,name=Address" json:"Address,omitempty"`
	LastAdded    int64         `protobuf:"varint,5,opt,name=LastAdded" json:"LastAdded,omitempty"`
	LastDeleted  int64         `protobuf:"varint,6,opt,name=LastDeleted" json:"LastDeleted,omitempty"`
	MemoryUsage  *MemoryUsage  `protobuf:"bytes,7,opt,name=MemoryUsage" json:"MemoryUsage,omitempty"`
	ComputeUsage *ComputeUsage `protobuf:"bytes,8,opt,name=ComputeUsage" json:"ComputeUsage,omitempty"`
	Runtime      string        `protobuf:"bytes,9,opt,name=Runtime" json:"Runtime,omitempty"`
	Services     []string      `protobuf:"bytes,10,rep,name=Services" json:"Services,omitempty"`
	Started      int64         `protobuf:"varint,11,opt,name=Started" json:"Started,omitempty"`
}

func (*Peer) Descriptor

func (*Peer) Descriptor() ([]byte, []int)

func (*Peer) GetAddress

func (m *Peer) GetAddress() string

func (*Peer) GetComputeUsage added in v0.0.20

func (m *Peer) GetComputeUsage() *ComputeUsage

func (*Peer) GetHostname

func (m *Peer) GetHostname() string

func (*Peer) GetID

func (m *Peer) GetID() string

func (*Peer) GetLastAdded

func (m *Peer) GetLastAdded() int64

func (*Peer) GetLastDeleted

func (m *Peer) GetLastDeleted() int64

func (*Peer) GetMemoryUsage added in v0.0.20

func (m *Peer) GetMemoryUsage() *MemoryUsage

func (*Peer) GetMeshID

func (m *Peer) GetMeshID() string

func (*Peer) GetRuntime added in v0.0.20

func (m *Peer) GetRuntime() string

func (*Peer) GetServices added in v0.0.22

func (m *Peer) GetServices() []string

func (*Peer) GetStarted added in v0.0.23

func (m *Peer) GetStarted() int64

func (*Peer) IsAdded

func (s *Peer) IsAdded() bool

func (*Peer) IsRemoved

func (s *Peer) IsRemoved() bool

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) Reset

func (m *Peer) Reset()

func (*Peer) String

func (m *Peer) String() string

type PeerList

type PeerList struct {
	Peers []*Peer `protobuf:"bytes,1,rep,name=Peers" json:"Peers,omitempty"`
}

func (*PeerList) Append

func (e *PeerList) Append(entry state.Entry)

func (PeerList) Apply

func (set PeerList) Apply(f func(s *Peer))

func (PeerList) ApplyE

func (set PeerList) ApplyE(f func(s *Peer) error) error

func (PeerList) ApplyIdx

func (set PeerList) ApplyIdx(f func(idx int, s *Peer))

func (*PeerList) AtIndex

func (e *PeerList) AtIndex(idx int) state.Entry

func (*PeerList) Descriptor

func (*PeerList) Descriptor() ([]byte, []int)

func (PeerList) Filter

func (set PeerList) Filter(filters ...peerFilter) PeerList

func (*PeerList) GetPeers

func (m *PeerList) GetPeers() []*Peer

func (*PeerList) Length

func (e *PeerList) Length() int

func (*PeerList) New

func (e *PeerList) New() state.EntrySet

func (*PeerList) ProtoMessage

func (*PeerList) ProtoMessage()

func (*PeerList) Range

func (e *PeerList) Range(f func(idx int, entry state.Entry))

func (*PeerList) Reset

func (m *PeerList) Reset()

func (*PeerList) Set

func (e *PeerList) Set(idx int, entry state.Entry)

func (*PeerList) String

func (m *PeerList) String() string

type PeerStore

type PeerStore interface {
	ByID(id string) (*Peer, error)
	ByMeshID(id string) (*Peer, error)
	All() (PeerList, error)
	Exists(id string) bool
	Upsert(p *Peer) error
	Delete(id string) error
	On(event string, handler func(*Peer)) func()
	DumpPeers() *PeerList
}

func NewPeerStore

func NewPeerStore(mesh cluster.Mesh) (PeerStore, error)

Jump to

Keyboard shortcuts

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