node

package module
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: AGPL-3.0 Imports: 13 Imported by: 14

README

apiserviceNode

The apiservice Node is the implementation of the node part from the unified api. The api service node is available in all Perinets Products.

This implementation does store its resources, e.g. NodeInfo object or the ProductionInfo object persistently in the file system /var/lib/apiservice-node/ as json files.

References

Dual License

This software is by default licensed via the GNU Affero General Public License version 3. However it is also available with a commercial license on request (https://perinet.io/contact).

Documentation

Overview

Container dedicated implementation for the API service Node of Perinets unified API. It provides node specific meta information, general funding configuration values like application_name and element_name as well as production information

Index

Constants

View Source
const (
	API_VERSION = "23"
)

Variables

This section is empty.

Functions

func ErrorStatusReset added in v1.0.3

func ErrorStatusReset(p periHttp.PeriHttp)

func ErrorStatusSet added in v1.0.3

func ErrorStatusSet(p periHttp.PeriHttp)

func LifeStateSet

func LifeStateSet(p periHttp.PeriHttp)

func NodeConfigGet

func NodeConfigGet(p periHttp.PeriHttp)

func NodeConfigReset added in v1.0.3

func NodeConfigReset(p periHttp.PeriHttp)

func NodeConfigSet

func NodeConfigSet(p periHttp.PeriHttp)

func NodeInfoGet

func NodeInfoGet(p periHttp.PeriHttp)

func ProductionInfoGet

func ProductionInfoGet(p periHttp.PeriHttp)

func ProductionInfoSet

func ProductionInfoSet(p periHttp.PeriHttp)

func RegisterNodeEventCallback added in v1.0.3

func RegisterNodeEventCallback(cb NodeEventCallback)

func ServicesGet

func ServicesGet(p periHttp.PeriHttp)

func ServicesSet

func ServicesSet(p periHttp.PeriHttp)

func SetServiceConfig

func SetServiceConfig(serviceConfig ServiceConfig)

func UnegisterNodeEventCallback added in v1.0.3

func UnegisterNodeEventCallback(cb NodeEventCallback)

func UnmarshalWithAdditionalProperties added in v1.0.3

func UnmarshalWithAdditionalProperties(data []byte, target interface{}) error

Types

type ContainerMetaInfo

type ContainerMetaInfo struct {
	Version   string `json:"version"`
	Container string `json:"container"`
	Support   string `json:"support"`
	Mantainer string `json:"mantainer"`
}

type FirmwareInfo

type FirmwareInfo struct {
	Version   string `json:"version"`
	Name      string `json:"name"`
	Specifier string `json:"specifier"`
}

type NodeConfig

type NodeConfig struct {
	ApplicationName string `json:"application_name"`
	ElementName     string `json:"element_name"`
}

type NodeErrorStatus added in v1.0.3

type NodeErrorStatus = nodeErrorStatus.Enum

type NodeEventCallback added in v1.0.3

type NodeEventCallback func()

type NodeInfo

type NodeInfo struct {
	ApiVersion json.Number `json:"api_version"`

	Config *NodeConfig `json:"config"`

	LifeState NodeLifeState `json:"life_state"`

	Services []string `json:"services"`

	ErrorStatus NodeErrorStatus `json:"error_status"`

	Firmware FirmwareInfo `json:"firmware"`
}

NodeInfo - Basic Node information

type NodeLifeState

type NodeLifeState = nodeLifeState.Enum

type PathInfo

type PathInfo = httpserver.PathInfo

func PathsGet

func PathsGet() []PathInfo

Get a list of public available paths

type ProductionInfo

type ProductionInfo struct {
	WithAdditionalProperties // accept additional properties added during production

	Manufacturer string `json:"manufacturer"`

	// Manufacturer Part Number
	Mpn string `json:"mpn"`

	SerialNumber string `json:"serial_number"`

	ProductVersion string `json:"product_version"`

	ProductVariant string `json:"product_variant"`

	// Manufacturer production batch identification
	BatchNumber string `json:"batch_number"`

	ProductName string `json:"product_name"`

	Hostname string `json:"hostname"`

	IsFused bool `json:"is_fused"`
}

func (ProductionInfo) MarshalJSON added in v1.0.3

func (p ProductionInfo) MarshalJSON() ([]byte, error)

type ServiceConfig

type ServiceConfig struct {
	FirmwareInfo    FirmwareInfo
	StorageBasePath string
}

type WithAdditionalProperties added in v1.0.3

type WithAdditionalProperties struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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