control

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 25 Imported by: ? 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

Overview

Package control exposes the live device control API under /api/:project_id/device/:device_id/...

Index

Constants

View Source
const LeaseHeader = "X-Device-Lease"

LeaseHeader carries the lease token for control calls.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppResolver

type AppResolver func(c *gin.Context, binaryID uint) (*app.Parameter, error)

AppResolver returns the app parameters for an app bundle of the project.

type DeviceResolver

type DeviceResolver func(c *gin.Context) (device.Device, bool)

DeviceResolver resolves the device addressed by the request. It writes the error response itself and returns false when the device can't be used.

type Handler

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

func NewHandler

func NewHandler(svc *hubcontrol.Service, resolveDevice DeviceResolver, resolveApp AppResolver, owner OwnerResolver, nodeURL string) *Handler

func (*Handler) Register

func (h *Handler) Register(g *gin.RouterGroup)

Register adds the routes to a project scoped group.

func (*Handler) WithAllowedOrigins

func (h *Handler) WithAllowedOrigins(origins []string) *Handler

WithAllowedOrigins lets pages from these origins (e.g. the configured CORS origins) open the video websocket. Same-host pages are always allowed.

type OwnerResolver

type OwnerResolver func(c *gin.Context) string

OwnerResolver names the caller, e.g. the user or access token name.

Jump to

Keyboard shortcuts

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