Documentation
¶
Index ¶
- Constants
- Variables
- func NormaliseProtocol(p statev1.ServiceProtocol) statev1.ServiceProtocol
- type AddressesChanged
- type BlobSpec
- type BlobSpecView
- type Digest
- type Event
- type NodeResources
- type NodeView
- type PeerDenied
- type PeerJoined
- type Service
- type ServiceChanged
- type ServiceInfo
- type Snapshot
- func (s Snapshot) BlobByName(name string) (string, BlobSpecView, bool)
- func (s Snapshot) DeniedPeers() []types.PeerKey
- func (s Snapshot) Digest() Digest
- func (s Snapshot) LocalSpecByName(name string, localID types.PeerKey) (string, bool)
- func (s Snapshot) PeersWithBlob(hash string) []types.PeerKey
- func (s Snapshot) Services() []ServiceInfo
- func (s Snapshot) SpecByName(name string) (string, WorkloadSpecView, bool)
- type StateStore
- type StaticChanged
- type StaticSpec
- type StaticSpecView
- type TopologyChanged
- type TrafficSnapshot
- type WorkloadChanged
- type WorkloadSpec
- type WorkloadSpecView
Constants ¶
View Source
const HeartbeatInterval = 15 * time.Second
Variables ¶
View Source
var ( ErrSpecOwnedByPeer = errors.New("spec already published by another peer") ErrInvalidDigest = errors.New("invalid manifest digest") )
Functions ¶
func NormaliseProtocol ¶
func NormaliseProtocol(p statev1.ServiceProtocol) statev1.ServiceProtocol
Backward compatibility: gossip data that predates the protocol field carries UNSPECIFIED, which callers treat as TCP.
Types ¶
type AddressesChanged ¶
type BlobSpecView ¶
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
func UnmarshalDigest ¶
type NodeResources ¶
type NodeView ¶
type NodeView struct {
LastEventAt time.Time
BackoffExpiry time.Time
TrafficRates map[types.PeerKey]TrafficSnapshot
Reachable map[types.PeerKey]struct{}
Services map[string]*Service
CallCounts map[string]uint64
Blobs map[string]struct{}
VivaldiCoord *coords.Coord
ObservedExternalIP string
LastAddr string
Name string
PeerPub []byte
IPs []string
NatType nat.Type
VivaldiErr float64
MemTotalBytes uint64
CertExpiry int64
MemPercent uint32
NumCPU uint32
CPUPercent uint32
ExternalPort uint32
LocalPort uint32
PubliclyAccessible bool
AdminCapable bool
CanServeStatic bool
}
type PeerDenied ¶
type PeerJoined ¶
type ServiceChanged ¶
type ServiceInfo ¶
type Snapshot ¶
type Snapshot struct {
Nodes map[types.PeerKey]NodeView
Specs map[string]WorkloadSpecView
Claims map[string]map[types.PeerKey]struct{}
DrainingClaims map[string]map[types.PeerKey]struct{}
StaticSpecs map[string]StaticSpecView
StaticClaims map[string]map[types.PeerKey]struct{}
BlobSpecs map[string]BlobSpecView
PeerKeys []types.PeerKey
DeniedKeys []types.PeerKey
LocalID types.PeerKey
// contains filtered or unexported fields
}
func (Snapshot) BlobByName ¶
func (s Snapshot) BlobByName(name string) (string, BlobSpecView, bool)
func (Snapshot) DeniedPeers ¶
func (Snapshot) LocalSpecByName ¶
func (Snapshot) PeersWithBlob ¶
PeersWithBlob returns live peers advertising hash. Stale BlobAvailability from offline peers persists in gossip until cert expiry; including them would direct fetches at unreachable nodes.
func (Snapshot) Services ¶
func (s Snapshot) Services() []ServiceInfo
func (Snapshot) SpecByName ¶
func (s Snapshot) SpecByName(name string) (string, WorkloadSpecView, bool)
type StateStore ¶
type StateStore interface {
Snapshot() Snapshot
ApplyDelta(from types.PeerKey, data []byte) ([]Event, []byte, error)
EncodeDelta(since Digest) []byte
EncodeFull() []byte
PendingNotify() <-chan struct{}
FlushPendingGossip() []*statev1.GossipEvent
DenyPeer(key types.PeerKey) []Event
SetLocalAddresses(addrs []netip.AddrPort) []Event
SetLocalNAT(t nat.Type) []Event
SetLocalCoord(c coords.Coord, coordErr float64) []Event
SetLocalReachable(peers []types.PeerKey) []Event
SetLocalObservedAddress(ip string, port uint32) []Event
PublishWorkload(spec WorkloadSpec) ([]Event, error)
DeleteWorkloadSpec(hash string) []Event
ClaimWorkload(hash string) []Event
MarkWorkloadDraining(hash string) []Event
ReleaseWorkload(hash string) []Event
SetLocalResources(r NodeResources) []Event
SetBackoffTTL(expiresAt time.Time) []Event
SetPerSeedCallCounts(counts map[string]uint64) []Event
SetLocalBlobs(digests []string) []Event
SetStaticSpec(spec StaticSpec) ([]Event, error)
DeleteStaticSpec(name string) []Event
ClaimStatic(name string) []Event
ReleaseStatic(name string) []Event
SetBlobSpec(spec BlobSpec) ([]Event, error)
DeleteBlobSpec(digest string) []Event
SetService(port uint32, name string, protocol statev1.ServiceProtocol, properties *structpb.Struct) []Event
RemoveService(name string) []Event
SetLocalTraffic(peer types.PeerKey, in, out uint64) []Event
EmitHeartbeatIfNeeded() []Event
LoadGossipState(data []byte) error
SetPeerLastAddr(pk types.PeerKey, addr string)
SetPublic()
SetAdmin()
ClearAdmin()
SetStaticCapable()
SetNodeName(name string)
ExportLastAddrs() map[types.PeerKey]string
LoadLastAddrs(addrs map[types.PeerKey]string)
}
func New ¶
func New(self types.PeerKey) StateStore
type StaticChanged ¶
type StaticChanged struct{ Name string }
type StaticSpec ¶
type StaticSpecView ¶
type StaticSpecView struct {
Spec StaticSpec
Publisher types.PeerKey
}
type TopologyChanged ¶
type TrafficSnapshot ¶
type WorkloadChanged ¶
type WorkloadChanged struct{ Hash string }
type WorkloadSpec ¶
type WorkloadSpecView ¶
type WorkloadSpecView struct {
Spec WorkloadSpec
Publisher types.PeerKey
}
Click to show internal directories.
Click to hide internal directories.