server

package
v0.2.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package server exposes the authenticated Integration and DeviceSession v1 runtime.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, config RuntimeConfig) error

Run serves the runtime until context cancellation, then performs a bounded shutdown.

Types

type Config

type Config struct {
	Store              sessionstore.Store
	Issuer             auth.Issuer
	Verifier           auth.Verifier
	Integration        integrationv1.Document
	RequestIdentity    RequestIdentity
	Readiness          func(context.Context) error
	LeaseDuration      time.Duration
	Heartbeat          time.Duration
	StreamDuration     time.Duration
	StreamHeartbeat    time.Duration
	StreamWriteTimeout time.Duration
}

type DeviceExecutor

type DeviceExecutor interface {
	FrameProducer
	Execute(context.Context, string, json.RawMessage) error
}

type DriverExecutor

type DriverExecutor struct{ Driver device.Driver }

func (DriverExecutor) CaptureFrame

func (executor DriverExecutor) CaptureFrame(ctx context.Context) (Frame, error)

func (DriverExecutor) Execute

func (executor DriverExecutor) Execute(ctx context.Context, command string, payload json.RawMessage) error

type Frame

type Frame struct {
	Content     []byte
	ContentType string
	Orientation string
	Width       int
	Height      int
}

type FrameProducer

type FrameProducer interface {
	CaptureFrame(context.Context) (Frame, error)
}

type Handler

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

func New

func New(config Config) (*Handler, error)

func (*Handler) ServeHTTP

func (handler *Handler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

type RequestIdentity

type RequestIdentity func(*http.Request) (certificateFingerprint, channelBindingSHA256 string, err error)

type RuntimeConfig

type RuntimeConfig struct {
	Address   string
	TLSConfig *tls.Config
	Handler   http.Handler
	Listener  net.Listener
	Started   func()
}

type Worker

type Worker struct {
	NodeLease        sessionstore.NodeLease
	Store            WorkerStore
	Executors        map[string]DeviceExecutor
	PollInterval     time.Duration
	ClaimDuration    time.Duration
	ExecutionTimeout time.Duration
	Now              func() time.Time
}

func (*Worker) Run

func (worker *Worker) Run(ctx context.Context) error

Jump to

Keyboard shortcuts

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