supervisor

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: 51 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoMatcher = errors.New("supervisor: authz matcher not configured")

Functions

This section is empty.

Types

type AuthzOptions

type AuthzOptions struct {
	Default      string
	Gates        map[string]string
	MatcherRules string
}

type ConnectionEntry

type ConnectionEntry struct {
	PeerKey    types.PeerKey
	RemotePort uint32
	LocalPort  uint32
	Protocol   statev1.ServiceProtocol
}

type Options

type Options struct {
	PacketConn         net.PacketConn
	ShutdownFunc       func()
	RuntimeState       *statev1.RuntimeState
	PeerCache          *peercache.Store
	Authz              AuthzOptions
	SocketPath         string
	PollenDir          string
	NodeName           string
	HTTPAddr           string
	StaticAddr         string
	ControlAddr        string
	ControlToken       string
	InitialServices    []ServiceEntry
	InitialConnections []ConnectionEntry
	AdvertisedIPs      []string
	SigningKey         ed25519.PrivateKey
	IdleInstanceTTL    time.Duration
	PeerTickInterval   time.Duration
	MaxConnectionAge   time.Duration
	GossipInterval     time.Duration
	GossipJitter       float64
	ListenPort         int
	MetricsEnabled     bool
	BootstrapPublic    bool
	DisableNATPunch    bool
	RelayOnly          bool
}

type ServiceEntry

type ServiceEntry struct {
	Properties *structpb.Struct
	Name       string
	Port       uint32
	Protocol   statev1.ServiceProtocol
}

type Supervisor

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

func New

func New(opts Options, creds *auth.NodeCredentials, inviteConsumer auth.InviteConsumer) (*Supervisor, error)

func (*Supervisor) AddDesiredConnection

func (n *Supervisor) AddDesiredConnection(pk types.PeerKey, remotePort, localPort uint32, protocol statev1.ServiceProtocol)

func (*Supervisor) Connect

func (n *Supervisor) Connect(ctx context.Context, pk types.PeerKey, addrs []netip.AddrPort) error

func (*Supervisor) ControlMetrics

func (n *Supervisor) ControlMetrics() control.Metrics

func (*Supervisor) ControlService

func (n *Supervisor) ControlService() *control.Service

func (*Supervisor) Credentials

func (n *Supervisor) Credentials() *auth.NodeCredentials

func (*Supervisor) DesiredConnections

func (n *Supervisor) DesiredConnections() []tunneling.ConnectionInfo

func (*Supervisor) GetActivePeerAddress

func (n *Supervisor) GetActivePeerAddress(pk types.PeerKey) (*net.UDPAddr, bool)

func (*Supervisor) GetConnectedPeers

func (n *Supervisor) GetConnectedPeers() []types.PeerKey

func (*Supervisor) JoinWithInvite

func (n *Supervisor) JoinWithInvite(ctx context.Context, token *admissionv1.InviteToken) (*admissionv1.JoinToken, error)

func (*Supervisor) ListenPort

func (n *Supervisor) ListenPort() int

func (*Supervisor) Membership

func (n *Supervisor) Membership() membership.MembershipAPI

func (*Supervisor) PeerRTT

func (n *Supervisor) PeerRTT(pk types.PeerKey) (time.Duration, bool)

func (*Supervisor) PeerStateCounts

func (n *Supervisor) PeerStateCounts() transport.PeerStateCounts

func (*Supervisor) Ready

func (n *Supervisor) Ready() <-chan struct{}

func (*Supervisor) ReconnectWindowDuration

func (n *Supervisor) ReconnectWindowDuration() time.Duration

func (*Supervisor) ReloadAuthzMatcher

func (n *Supervisor) ReloadAuthzMatcher() error

A failed reload leaves the previous rules in place.

func (*Supervisor) RouteRequest

func (n *Supervisor) RouteRequest(ctx context.Context, uri wasm.URI, input []byte) ([]byte, error)

func (*Supervisor) Run

func (n *Supervisor) Run(ctx context.Context) error

func (*Supervisor) SeedWorkload

func (n *Supervisor) SeedWorkload(wasmBytes []byte, spec state.WorkloadSpec) (string, error)

func (*Supervisor) StateStore

func (n *Supervisor) StateStore() state.StateStore

func (*Supervisor) Tunneling

func (n *Supervisor) Tunneling() tunneling.TunnelingAPI

func (*Supervisor) UnseedWorkload

func (n *Supervisor) UnseedWorkload(hash string) error

Jump to

Keyboard shortcuts

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