ice

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Scheme                = "gonzb+ice"
	TransportNodeIDHeader = "X-GoNZBNet-Transport-Node-ID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Coordinators          []CoordinatorConfig
	AllowTURN             bool
	GatherTimeout         time.Duration
	ConnectTimeout        time.Duration
	IdleTimeout           time.Duration
	MaxPeerConnections    int
	AllowedBasePath       string
	MaxBodyBytes          int64
	RequestTimeout        time.Duration
	MaxInboundRequests    int
	MaxInflightBytes      int64
	ChannelsPerMinute     int
	RequestsPerMinute     int
	RemoteIPAllowed       func(net.IP) bool
	LocalInterfaceAllowed func(string) bool
	VerifyPeerKey         func(context.Context, string, ed25519.PublicKey) error
	Observe               func(Observation)
}

type CoordinatorConfig

type CoordinatorConfig struct {
	URL                    string
	Credential             string
	AllowPrivateICEServers bool
	AllowedICEServerHosts  []string
}

type CoordinatorStatus

type CoordinatorStatus struct {
	URL        string `json:"url"`
	Reachable  bool   `json:"reachable"`
	Reconnects int64  `json:"reconnects"`
}

type Identity

type Identity interface {
	protocol.Signer
}

type Manager

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

func New

func New(identity Identity, cfg Config) (*Manager, error)

func (*Manager) Close

func (m *Manager) Close() error

func (*Manager) CoordinatorStatus

func (m *Manager) CoordinatorStatus() []map[string]any

CoordinatorStatus returns payload-safe operational metadata. It never includes credentials, SDP, candidates, or observed IP addresses.

func (*Manager) RoundTrip

func (m *Manager) RoundTrip(request *http.Request) (*http.Response, error)

func (*Manager) SetHandler

func (m *Manager) SetHandler(handler http.Handler)

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

func (*Manager) Status

func (m *Manager) Status() Status

Status returns bounded operational state without exposing candidate or credential material.

type Observation

type Observation struct {
	Coordinator   string
	PeerNodeID    string
	Reachable     bool
	PathType      string
	ICEState      string
	RTTMS         int64
	Reconnects    int64
	BytesSent     int64
	BytesReceived int64
	Failure       string
}

type PeerStatus

type PeerStatus struct {
	NodeID        string `json:"node_id"`
	Coordinator   string `json:"coordinator"`
	PathType      string `json:"path_type"`
	Connection    string `json:"connection_state"`
	ICEState      string `json:"ice_state"`
	RTTMS         int64  `json:"rtt_ms"`
	Restarts      int64  `json:"restarts"`
	BytesSent     int64  `json:"bytes_sent"`
	BytesReceived int64  `json:"bytes_received"`
	Active        int32  `json:"active_requests"`
	Inbound       int32  `json:"inbound_requests"`
	Channels      int32  `json:"inbound_channels"`
}

type Status

type Status struct {
	NodeID            string              `json:"node_id"`
	Coordinators      []CoordinatorStatus `json:"coordinators"`
	Peers             []PeerStatus        `json:"peers"`
	InflightBodyBytes int64               `json:"inflight_body_bytes"`
}

Status is a payload-safe point-in-time transport snapshot for health checks, lab assertions, and operators. It deliberately omits SDP, candidates, credentials, local addresses, and remote addresses.

Jump to

Keyboard shortcuts

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