node

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NodeAPI

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

func New

func New(ctx context.Context, logger *zap.Logger, storage storageTY.Plugin, bus busTY.Plugin) *NodeAPI

func (*NodeAPI) Delete

func (n *NodeAPI) Delete(IDs []string) (int64, error)

Delete node

func (*NodeAPI) Get

func (n *NodeAPI) Get(filters []storageTY.Filter) (nodeTY.Node, error)

Get returns a Node

func (*NodeAPI) GetByGatewayAndNodeID

func (n *NodeAPI) GetByGatewayAndNodeID(gatewayID, nodeID string) (*nodeTY.Node, error)

GetByGatewayAndNodeID returns a node details by gatewayID and nodeId of a message

func (*NodeAPI) GetByID

func (n *NodeAPI) GetByID(id string) (*nodeTY.Node, error)

GetByID returns a node details by id

func (*NodeAPI) GetByIDs

func (n *NodeAPI) GetByIDs(ids []string) ([]nodeTY.Node, error)

GetByIDs returns a node details by id

func (*NodeAPI) GetEntityInterface

func (n *NodeAPI) GetEntityInterface() interface{}

func (*NodeAPI) Import

func (n *NodeAPI) Import(data interface{}) error

func (*NodeAPI) List

func (n *NodeAPI) List(filters []storageTY.Filter, pagination *storageTY.Pagination) (*storageTY.Result, error)

List by filter and pagination

func (*NodeAPI) Save

func (n *NodeAPI) Save(node *nodeTY.Node, publishEvent bool) error

Save Node config into disk

func (*NodeAPI) UpdateFirmwareState

func (n *NodeAPI) UpdateFirmwareState(id string, data map[string]interface{}) error

UpdateFirmwareState func

func (*NodeAPI) VerifyNodeUpStatus

func (n *NodeAPI) VerifyNodeUpStatus(inactiveDuration time.Duration)

Verifies node up status by checking the last seen timestamp if the last seen greater than x minutes/seconds or specified duration in that node will be marked as down

Jump to

Keyboard shortcuts

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