api

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: BSD-3-Clause-Clear Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigHistoryLimit = storage.ConfigHistoryLimit
	ConfigSotaOverride = storage.ConfigSotaOverride
)

Variables

View Source
var (
	CtxGetLog  = context.CtxGetLog
	CtxWithLog = context.CtxWithLog
)
View Source
var EchoError = server.EchoError

Functions

func CtxGetUser

func CtxGetUser(ctx Context) *users.User

func RegisterHandlers

func RegisterHandlers(e *echo.Echo, ca *DeviceCa, storage *storage.Storage, userStorage *users.Storage, a auth.Provider)

Types

type AppliedConfigs

type AppliedConfigs = storage.AppliedConfigs

type AppsStatesResp

type AppsStatesResp struct {
	AppsStates []storage.AppsStates `json:"apps_states"`
}

type CertOpts added in v0.9.5

type CertOpts struct {
	Names []string `query:"name"`
}

type CertResp added in v0.9.5

type CertResp map[string]string

type ConfigFile

type ConfigFile = storage.ConfigFile

type ConfigFileSet

type ConfigFileSet = storage.ConfigFileSet

type Context

type Context = context.Context

func CtxWithUser

func CtxWithUser(ctx Context, user *users.User) Context

type Device

type Device = storage.Device

type DeviceCa added in v0.9.3

type DeviceCa struct {
	CaCert   *x509.Certificate
	CaKey    crypto.Signer
	RootCert string
	DgUrl    string
}

func LoadDeviceCa added in v0.9.3

func LoadDeviceCa(fs *storage.FsHandle, gatewayAddr string) (*DeviceCa, error)

func (DeviceCa) SignCsr added in v0.9.3

func (ca DeviceCa) SignCsr(csr *x509.CertificateRequest) ([]byte, error)

type DeviceCodeRequest added in v0.9.5

type DeviceCodeRequest struct {
	Scopes       string `form:"scope"`
	TokenExpires int64  `form:"token_expires"`
}

type DeviceCodeResponse added in v0.9.5

type DeviceCodeResponse struct {
	DeviceCode              string `json:"device_code"`
	UserCode                string `json:"user_code"`
	VerificationURI         string `json:"verification_uri"`
	VerificationURIComplete string `json:"verification_uri_complete"`
	ExpiresIn               int    `json:"expires_in"` // seconds until expiry, per RFC 8628
	Interval                int    `json:"interval"`
}

type DeviceCreateRequest added in v0.9.3

type DeviceCreateRequest struct {
	Uuid          string   `json:"uuid"`
	Name          string   `json:"name"` // todo validate pattern and length
	Group         string   `json:"group"`
	HardwareId    string   `json:"hardware-id"`
	Csr           string   `json:"csr"`
	SotaConfigDir string   `json:"sota-config-dir"`
	Overrides     SotaToml `json:"overrides"`
}

type DeviceCreateResponse added in v0.9.3

type DeviceCreateResponse struct {
	RootCrt   string `json:"root.crt"`
	ClientPem string `json:"client.pem"`
	SotaToml  string `json:"sota.toml"`
}

type DeviceListItem

type DeviceListItem = storage.DeviceListItem

type DeviceListOpts

type DeviceListOpts = storage.DeviceListOpts

type DeviceTokenRequest added in v0.9.5

type DeviceTokenRequest struct {
	DeviceCode string `form:"device_code"`
	GrantType  string `form:"grant_type"`
}

type DeviceTokenResponse added in v0.9.5

type DeviceTokenResponse struct {
	AccessToken string `json:"access_token"`
	TokenType   string `json:"token_type"`
	Expires     int64  `json:"expires"`
	Scopes      string `json:"scope"`
}

type DeviceUpdateEvent

type DeviceUpdateEvent = storage.DeviceUpdateEvent

type LabelsPutReq

type LabelsPutReq map[string]*string

type LabelsReq

type LabelsReq struct {
	Upserts map[string]string
	Deletes []string
}

type Rollout

type Rollout = storage.Rollout

type SotaToml added in v0.9.3

type SotaToml map[string]map[string]string

type TargetTest

type TargetTest = storage.TargetTest

type Update

type Update = storage.Update

type UpdateSummary added in v0.9.4

type UpdateSummary = storage.UpdateSummary

type UpdateTufItemResp added in v0.9.5

type UpdateTufItemResp = map[string]any

type UpdateTufResp

type UpdateTufResp = map[string]UpdateTufItemResp

Jump to

Keyboard shortcuts

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