coordinator

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShutdownServer

func ShutdownServer(ctx context.Context, server *http.Server) error

func ValidateConfig

func ValidateConfig(cfg Config) error

Types

type Config

type Config struct {
	AdminToken                 string
	TURNSecret                 string
	TURNURIs                   []string
	STUNURIs                   []string
	TURNCredentialTTL          time.Duration
	MaxRegistrationsPerNode    int
	MaxNegotiationsPerNode     int
	NegotiationsPerMinute      int
	MaxMessageBytes            int64
	MessagesPerMinute          int
	SignalBytesPerMinute       int64
	GlobalMessagesPerMinute    int
	GlobalSignalBytesPerMinute int64
	AuthAttemptsPerMinute      int
	GlobalAuthPerMinute        int
	MaxConcurrentAuth          int
	MaxInvalidMessages         int
	MaxTotalRegistrations      int
	ReplayCacheEntries         int
	WebSocketReadTimeout       time.Duration
	WebSocketPingInterval      time.Duration
	AllowedOrigins             []string
	TrustProxyHeaders          bool
}

type EnrollmentStore

type EnrollmentStore interface {
	CreateEnrollment(context.Context) (string, error)
	BindEnrollment(context.Context, string, string, string) error
	RevokeEnrollment(context.Context, string) (bool, error)
}

type Server

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

func NewServer

func NewServer(store EnrollmentStore, cfg Config) *Server

func (*Server) Handler

func (s *Server) Handler() http.Handler

type Store

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

func OpenStore

func OpenStore(ctx context.Context, databaseURL string) (*Store, error)

func (*Store) BindEnrollment

func (s *Store) BindEnrollment(ctx context.Context, token, nodeID, publicKey string) error

func (*Store) Close

func (s *Store) Close()

func (*Store) CreateEnrollment

func (s *Store) CreateEnrollment(ctx context.Context) (string, error)

func (*Store) RevokeEnrollment

func (s *Store) RevokeEnrollment(ctx context.Context, tokenID string) (bool, error)

Jump to

Keyboard shortcuts

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