loopback

package
v1.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ProtocolVersion        = 9
	ServiceName            = "piik-client"
	ControlSubprotocol     = "piik-client-v9"
	MaxControlMessageBytes = 256 << 10
	DefaultPortStart       = 39721
	DefaultPortEnd         = 39730
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlEvent added in v1.5.6

type ControlEvent struct {
	Value   any
	Current func() bool
}

ControlEvent retains a physical owner's validity through asynchronous queues. Current must only inspect ownership; it runs under the WebSocket write lock.

type ControlSession

type ControlSession interface {
	// Errors reject protocol violations and close this control connection.
	// Valid operation failures return a response instead of ending the session.
	// A nil response with no error is completed later through Events, using the request ID.
	Handle(context.Context, []byte) (any, error)
	Events() <-chan any
	Close() error
}

type Endpoint

type Endpoint struct {
	URL           string `json:"url"`
	Host          string `json:"host"`
	Port          int    `json:"port"`
	InstanceToken string `json:"instanceToken"`
}

type Health

type Health struct {
	Protocol      int                     `json:"protocol"`
	Service       string                  `json:"service"`
	Port          int                     `json:"port"`
	InstanceToken string                  `json:"instanceToken"`
	NativeMedia   NativeMediaCapabilities `json:"nativeMedia"`
}

type NativeMediaCapabilities

type NativeMediaCapabilities struct {
	ReceiverReuse         bool `json:"receiverReuse,omitempty"`
	Video                 bool `json:"video"`
	CaptureBorderControl  bool `json:"captureBorderControl,omitempty"`
	Microphone            bool `json:"microphone,omitempty"`
	ProcessAudio          bool `json:"processAudio"`
	ProcessAudioExclusion bool `json:"processAudioExclusion,omitempty"`
	SystemAudio           bool `json:"systemAudio"`
	HardwareH264          bool `json:"hardwareH264"`
	SoftwareVP8           bool `json:"softwareVP8"`
}

type Options

type Options struct {
	PortStart      int
	PortEnd        int
	AllowedOrigins []string
	NativeMedia    NativeMediaCapabilities
	NewControl     func() ControlSession
	Presentation   func(language string)
}

type Server

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

func Start

func Start(parent context.Context, options Options) (*Server, error)

func (*Server) Close

func (server *Server) Close() error

func (*Server) Done

func (server *Server) Done() <-chan error

func (*Server) Endpoint

func (server *Server) Endpoint() Endpoint

func (*Server) ServeHTTP

func (server *Server) ServeHTTP(response http.ResponseWriter, request *http.Request)

func (*Server) SetAllowedOrigins

func (server *Server) SetAllowedOrigins(origins []string)

Jump to

Keyboard shortcuts

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