Documentation
¶
Index ¶
- type Client
- func (c *Client) ChangeAPIPassword(newPassword string, timeout time.Duration) error
- func (c *Client) Close()
- func (c *Client) GetParameterSet(timeout time.Duration, namespace string) ([]byte, error)
- func (c *Client) GetPersistentParameter(name string, timeout time.Duration) (value string, err error)
- func (c *Client) IdentifyFirmware(timeout time.Duration) (name string, version string, err error)
- func (c *Client) IdentifyHardware(timeout time.Duration) (*core.HardwareInventory, error)
- func (c *Client) LoadFirmware(file string, chunkSize uint, timeout time.Duration, ...) (restartingNow bool, err error)
- func (c *Client) LoadFirmwareBinary(r *bufio.Reader, chunkSize uint, timeout time.Duration, ...) (restartingNow bool, err error)
- func (c *Client) LoadFirmwareBinaryFromFile(file string, chunkSize uint, timeout time.Duration, ...) (restartingNow bool, err error)
- func (c *Client) LoadFirmwareFromBuffer(buffer []byte, chunkSize uint, timeout time.Duration, ...) (restartingNow bool, err error)
- func (c *Client) LoadParameterSet(timeout time.Duration, namespace string, data []byte) ([]byte, error)
- func (c *Client) ProgramHardwareIdentification(i *core.HardwareInventory, timeout time.Duration) error
- func (c *Client) ReadPartition(timeout time.Duration, partitionName string, offset uint32, w *bufio.Writer, ...) (err error)
- func (c *Client) ReplCommand(cmd string, timeout time.Duration) (response string, err error)
- func (c *Client) ResetReason(timeout time.Duration) (reason string, err error)
- func (c *Client) Restart(timeout time.Duration) (restartingNow bool, err error)
- func (c *Client) SetPersistentParameter(name string, value string, timeout time.Duration) (bool, error)
- func (c *Client) StreamLogs(streamTimeout time.Duration, infoCb func(msg string)) (io.ReadCloser, error)
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 (*Client) ChangeAPIPassword ¶ added in v2.1.1
ChangeAPIPassword changes the API password of the device
func (*Client) GetParameterSet ¶
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 ¶
IdentifyFirmware gets the firmware name and version from the device
func (*Client) IdentifyHardware ¶
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
ReplCommand sends a REPL command to the device and returns the response
func (*Client) ResetReason ¶
ResetReason gets the reset reason
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