control

package
v0.0.1-dev.19 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const ControlTokenMetadataKey = "x-pln-token"

Variables

This section is empty.

Functions

This section is empty.

Types

type BlobsControl

type BlobsControl interface {
	Fetch(ctx context.Context, hash string, peers []types.PeerKey) error
	Put(r io.Reader) (string, error)
	SetName(hash, name string) error
	Remove(hash string) error
}

type MembershipControl

type MembershipControl interface {
	DenyPeer(key types.PeerKey) error
	IssueCert(ctx context.Context, peerKey types.PeerKey, admin bool, attributes *structpb.Struct) error
}

type MeshConnector

type MeshConnector interface {
	Connect(ctx context.Context, peer types.PeerKey, addrs []netip.AddrPort) error
}

type Metrics

type Metrics struct {
	CertExpirySeconds  float64
	CertRenewals       uint64
	CertRenewalsFailed uint64
	PunchAttempts      uint64
	PunchFailures      uint64
	SmoothedVivaldiErr float64
	VivaldiSamples     uint64
	EagerSyncs         uint64
	EagerSyncFailures  uint64
}

type MetricsSource

type MetricsSource interface {
	ControlMetrics() Metrics
}

type Option

type Option func(*Service)

func WithCredentials

func WithCredentials(c *auth.NodeCredentials) Option

func WithMeshConnector

func WithMeshConnector(c MeshConnector) Option

func WithMetricsSource

func WithMetricsSource(m MetricsSource) Option

func WithShutdown

func WithShutdown(fn func()) Option

func WithTransportInfo

func WithTransportInfo(t TransportInfo) Option

type PlacementControl

type PlacementControl interface {
	Seed(binary []byte, spec state.WorkloadSpec) error
	Unseed(hash string) error
	Call(ctx context.Context, hash, fn string, input []byte) ([]byte, error)
	Status() []placement.WorkloadSummary
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(membership MembershipControl, placement PlacementControl, tunneling TunnelingControl, blobs BlobsControl, sc StaticControl, state StateReader, opts ...Option) *Server

func (*Server) Serve

func (s *Server) Serve(l net.Listener) error

func (*Server) Service

func (s *Server) Service() *Service

func (*Server) SetToken

func (s *Server) SetToken(token string)

func (*Server) Start

func (s *Server) Start(socketPath string) error

func (*Server) StartTCP

func (s *Server) StartTCP(addr string) error

func (*Server) Stop

func (s *Server) Stop()

type Service

type Service struct {
	controlv1.UnimplementedControlServiceServer
	// contains filtered or unexported fields
}

func NewService

func NewService(membership MembershipControl, placement PlacementControl, tunneling TunnelingControl, blobs BlobsControl, sc StaticControl, state StateReader, opts ...Option) *Service

func (*Service) CallWorkload

func (*Service) ConnectPeer

func (*Service) DenyPeer

func (*Service) FetchBlob

func (*Service) IssueCert

func (*Service) RemoveBlob

func (*Service) SeedStatic

func (*Service) Shutdown

type StateReader

type StateReader interface {
	Snapshot() state.Snapshot
}

type StaticControl

type StaticControl interface {
	SeedStatic(name string, manifestDigest []byte) error
	UnseedStatic(name string) error
	StaticBlobs() map[string]struct{}
}

type TransportInfo

type TransportInfo interface {
	PeerStateCounts() transport.PeerStateCounts
	GetActivePeerAddress(types.PeerKey) (*net.UDPAddr, bool)
	PeerRTT(types.PeerKey) (time.Duration, bool)
	ReconnectWindowDuration() time.Duration
}

type TunnelingControl

type TunnelingControl interface {
	Connect(ctx context.Context, peer types.PeerKey, remotePort, localPort uint32, protocol statev1.ServiceProtocol) (uint32, error)
	Disconnect(service string) error
	ExposeService(port uint32, name string, protocol statev1.ServiceProtocol, properties *structpb.Struct) error
	UnexposeService(name string) error
	ListConnections() []tunneling.ConnectionInfo
}

Jump to

Keyboard shortcuts

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