core

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client represents a client for the io4edge core function via REST API

func New

func New(address string, password string) (*Client, error)

New creates a new client for the io4edge core functions via REST API

func (*Client) ChangeAPIPassword added in v2.1.1

func (c *Client) ChangeAPIPassword(newPassword string, timeout time.Duration) error

ChangeAPIPassword changes the API password of the device

func (*Client) Close

func (c *Client) Close()

Close closes the client. Here it does nothing

func (*Client) GetParameterSet

func (c *Client) GetParameterSet(timeout time.Duration, namespace string) ([]byte, error)

GetParameterSet gets the parameter set from the device

func (*Client) GetPersistentParameter

func (c *Client) GetPersistentParameter(name string, timeout time.Duration) (value string, err error)

GetPersistentParameter gets a persistent parameter name is the name of the parameter, it can be in the form "namespace.parameter" or just "parameter"

func (*Client) IdentifyFirmware

func (c *Client) IdentifyFirmware(timeout time.Duration) (name string, version string, err error)

IdentifyFirmware gets the firmware name and version from the device

func (*Client) IdentifyHardware

func (c *Client) IdentifyHardware(timeout time.Duration) (*core.HardwareInventory, error)

IdentifyHardware gets the firmware name and version from the device TODO: support customer part number

func (*Client) LoadFirmware

func (c *Client) LoadFirmware(file string, chunkSize uint, timeout time.Duration, prog func(bytes uint, msg string)) (restartingNow bool, err error)

LoadFirmware loads a binary from a firmware package to the device. Checks first if the firmware is compatible with the device. Checks then if the device's firmware version is the same timeout is for each chunk

func (*Client) LoadFirmwareBinary

func (c *Client) LoadFirmwareBinary(r *bufio.Reader, chunkSize uint, timeout time.Duration, prog func(bytes uint, msg string)) (restartingNow bool, err error)

LoadFirmwareBinary loads new firmware from r into the device device

func (*Client) LoadFirmwareBinaryFromFile

func (c *Client) LoadFirmwareBinaryFromFile(file string, chunkSize uint, timeout time.Duration, prog func(bytes uint, msg string)) (restartingNow bool, err error)

LoadFirmwareBinaryFromFile loads new firmware from file into the device device timeout is for each chunk

func (*Client) LoadFirmwareFromBuffer

func (c *Client) LoadFirmwareFromBuffer(buffer []byte, chunkSize uint, timeout time.Duration, prog func(bytes uint, msg string)) (restartingNow bool, err error)

LoadFirmwareFromBuffer loads a binary from a firmware package in memory to the device. Checks first if the firmware is compatible with the device. Checks then if the device's firmware version is the same timeout is for each chunk

func (*Client) LoadParameterSet

func (c *Client) LoadParameterSet(timeout time.Duration, namespace string, data []byte) ([]byte, error)

LoadParameterSet loads the parameter set to the device

func (*Client) ProgramHardwareIdentification

func (c *Client) ProgramHardwareIdentification(i *core.HardwareInventory, timeout time.Duration) error

ProgramHardwareIdentification programs the hardware identification

func (*Client) ReadPartition

func (c *Client) ReadPartition(timeout time.Duration, partitionName string, offset uint32, w *bufio.Writer, prog func(bytes uint, msg string)) (err error)

ReadPartition reads a partition from the device

func (*Client) ReplCommand added in v2.1.1

func (c *Client) ReplCommand(cmd string, timeout time.Duration) (response string, err error)

ReplCommand sends a REPL command to the device and returns the response

func (*Client) ResetReason

func (c *Client) ResetReason(timeout time.Duration) (reason string, err error)

ResetReason gets the reset reason

func (*Client) Restart

func (c *Client) Restart(timeout time.Duration) (restartingNow bool, err error)

Restart restarts the device

func (*Client) SetPersistentParameter

func (c *Client) SetPersistentParameter(name string, value string, timeout time.Duration) (bool, error)

SetPersistentParameter sets a persistent parameter name is the name of the parameter, it can be in the form "namespace.parameter" or just "parameter"

func (*Client) StreamLogs

func (c *Client) StreamLogs(streamTimeout time.Duration, infoCb func(msg string)) (io.ReadCloser, error)

StreamLogs streams the logs from the device

Jump to

Keyboard shortcuts

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