axmanifest

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Overview

Package axmanifest provides a Go implementation of the Application Manifest Schema for Axis Camera Application Platform (ACAP) applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ACAPPackageConf

type ACAPPackageConf struct {
	Setup          Setup          `json:"setup" validate:"required"`
	Installation   Installation   `json:"installation,omitempty"`
	Uninstallation Uninstallation `json:"uninstallation,omitempty"`
	Configuration  Configuration  `json:"configuration,omitempty"`
	CopyProtection CopyProtection `json:"copyProtection"`
}

ACAPPackageConf represents an ACAP package configuration object.

type ApplicationManifestSchema

type ApplicationManifestSchema struct {
	SchemaVersion   string          `json:"schemaVersion" validate:"required,regexp=^1\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)$"`
	Resources       Resources       `json:"resources,omitempty"`
	ACAPPackageConf ACAPPackageConf `json:"acapPackageConf" validate:"required"`
}

func LoadManifest

func LoadManifest(manifest_path string) (*ApplicationManifestSchema, error)

type Configuration

type Configuration struct {
	SettingPage  string             `json:"settingPage" validate:"omitempty,regexp=^[\\w\\.-]+$"`
	HttpConfig   []HttpConfigItem   `json:"httpConfig,omitempty"`
	ParamConfig  []ParamConfigItem  `json:"paramConfig,omitempty"`
	ReverseProxy []ReverseProxyItem `json:"reverseProxy,omitempty"`
}

Configuration pertains to ACAP application interaction setup.

type CopyProtection

type CopyProtection struct {
	Method string `json:"method" validate:"required,oneof=none axis custom"`
}

CopyProtection outlines the ACAP application's copy protection utilization.

type DBusResources

type DBusResources struct {
	RequiredMethods    []string `json:"requiredMethods,omitempty"`
	ConditionalMethods []string `json:"conditionalMethods,omitempty"`
}

DBusResources details D-Bus resources on the host system that the application requires or desires access to.

type HttpConfigItem

type HttpConfigItem struct {
	Type   string `json:"type" validate:"required,oneof=transferCgi fastCgi directory"`
	Name   string `json:"name" validate:"omitempty,regexp=^[\\w/\\.-]+$"`
	Access string `json:"access" validate:"omitempty,oneof=admin operator viewer"`
}

HttpConfigItem describes a web server configuration object, which can be either a CGI configuration or web content configuration.

type Installation

type Installation struct {
	PostInstallScript string `json:"postInstallScript" validate:"omitempty,regexp=^[\\w\\.-]+$"`
}

Installation holds ACAP application installation settings.

type LinuxResources

type LinuxResources struct {
	User LinuxUser `json:"user,omitempty"`
}

LinuxResources specifies Linux resources on the host system that the application requires or desires access to.

type LinuxUser

type LinuxUser struct {
	Groups []string `json:"groups,omitempty"`
}

LinuxUser describes a dynamic user the application shall run as.

type ParamConfigItem

type ParamConfigItem struct {
	Name    string `json:"name" validate:"required"`
	Default string `json:"default" validate:"required"`
	Type    string `json:"type" validate:"required"`
}

ParamConfigItem defines a parameter configuration object for interaction with the Parameter API or the VAPIX API.

type Resources

type Resources struct {
	DBus  DBusResources  `json:"dbus,omitempty"`
	Linux LinuxResources `json:"linux,omitempty"`
}

Resources represents host resources the application requires access to.

type ReverseProxyItem

type ReverseProxyItem struct {
	ApiPath string `json:"apiPath" validate:"required,regexp=^[\\w\\-.+*?$\\(){}\\[\\]\\\\][\\w\\-.+*?$\\(){}\\[\\]\\\\/]+$"`
	ApiType string `json:"apiType" validate:"omitempty,oneof=http ws fcgi"`
	Target  string `json:"target" validate:"required"`
	Access  string `json:"access" validate:"required,oneof=admin operator viewer anonymous"`
}

ReverseProxyItem describes a reverse proxy configuration object, which can be for a unix domain socket or a TCP connection.

type Setup

type Setup struct {
	AppName            string `json:"appName" validate:"required,alphanum,max=26"`
	AppID              string `json:"appId" validate:"omitempty,numeric"`
	Architecture       string `json:"architecture" validate:"omitempty,oneof=all aarch64 armv7hf"`
	EmbeddedSdkVersion string `json:"embeddedSdkVersion" validate:"omitempty,semver"`
	FriendlyName       string `json:"friendlyName" validate:"omitempty"`
	User               User   `json:"user" validate:"required,dive"`
	RunMode            string `json:"runMode" validate:"required,oneof=respawn once never"`
	RunOptions         string `json:"runOptions" validate:"omitempty,regexp=^[\\w /\\.\\=-]+$"`
	Vendor             string `json:"vendor" validate:"required,regexp=^[\\w /\\-\\(\\),\\.\\!\\?&']+$"`
	VendorUrl          string `json:"vendorUrl" validate:"omitempty,url"`
	Version            string `json:"version" validate:"required,semver"`
}

Setup includes ACAP application identification and information settings.

type Uninstallation

type Uninstallation struct {
	PreUninstallScript string `json:"preUninstallScript" validate:"omitempty,regexp=^[\\w\\.-]+$"`
}

Uninstallation encompasses ACAP application uninstallation settings.

type User

type User struct {
	Username string `json:"username" validate:"required,lowercase,alphanum,startswithalpha,max=32"`
	Group    string `json:"group" validate:"required,lowercase,alphanum,startswithalpha,max=32"`
}

User defines static user and group information.

Jump to

Keyboard shortcuts

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