peers

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2019 License: MPL-2.0 Imports: 11 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:

Metadata
ComputeUsage
MemoryUsage
PeerMetadataList

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

This section is empty.

Types

type Channel added in v0.0.39

type Channel interface {
	Broadcast([]byte)
}

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 Metadata added in v0.0.39

type Metadata 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 (*Metadata) Descriptor added in v0.0.39

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

func (*Metadata) GetAddress added in v0.0.39

func (m *Metadata) GetAddress() string

func (*Metadata) GetComputeUsage added in v0.0.39

func (m *Metadata) GetComputeUsage() *ComputeUsage

func (*Metadata) GetHostname added in v0.0.39

func (m *Metadata) GetHostname() string

func (*Metadata) GetID added in v0.0.39

func (m *Metadata) GetID() string

func (*Metadata) GetLastAdded added in v0.0.39

func (m *Metadata) GetLastAdded() int64

func (*Metadata) GetLastDeleted added in v0.0.39

func (m *Metadata) GetLastDeleted() int64

func (*Metadata) GetMemoryUsage added in v0.0.39

func (m *Metadata) GetMemoryUsage() *MemoryUsage

func (*Metadata) GetMeshID added in v0.0.39

func (m *Metadata) GetMeshID() string

func (*Metadata) GetRuntime added in v0.0.39

func (m *Metadata) GetRuntime() string

func (*Metadata) GetServices added in v0.0.39

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

func (*Metadata) GetStarted added in v0.0.39

func (m *Metadata) GetStarted() int64

func (*Metadata) ProtoMessage added in v0.0.39

func (*Metadata) ProtoMessage()

func (*Metadata) Reset added in v0.0.39

func (m *Metadata) Reset()

func (*Metadata) String added in v0.0.39

func (m *Metadata) String() string

type Peer

type Peer struct {
	Metadata
}

type PeerMetadataList added in v0.0.39

type PeerMetadataList struct {
	Metadatas []*Metadata `protobuf:"bytes,1,rep,name=Metadatas" json:"Metadatas,omitempty"`
}

func (*PeerMetadataList) Descriptor added in v0.0.39

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

func (*PeerMetadataList) GetMetadatas added in v0.0.39

func (m *PeerMetadataList) GetMetadatas() []*Metadata

func (*PeerMetadataList) ProtoMessage added in v0.0.39

func (*PeerMetadataList) ProtoMessage()

func (*PeerMetadataList) Reset added in v0.0.39

func (m *PeerMetadataList) Reset()

func (*PeerMetadataList) String added in v0.0.39

func (m *PeerMetadataList) String() string

type PeerStore

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

func NewPeerStore

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

type SubscriptionSet added in v0.0.39

type SubscriptionSet []Peer

func (SubscriptionSet) Apply added in v0.0.39

func (set SubscriptionSet) Apply(f func(s Peer))

func (SubscriptionSet) ApplyE added in v0.0.39

func (set SubscriptionSet) ApplyE(f func(s Peer) error) error

func (SubscriptionSet) ApplyIdx added in v0.0.39

func (set SubscriptionSet) ApplyIdx(f func(idx int, s Peer))

func (SubscriptionSet) Filter added in v0.0.39

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

Jump to

Keyboard shortcuts

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