iot

package
v1.33.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 9 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
}

func (*Client) Close

func (c *Client) Close()

func (*Client) CreateTask

func (c *Client) CreateTask(task iot_grpcapi.InitialTaskDescription) (taskID string, err error)

func (*Client) CreateTaskWithContext

func (c *Client) CreateTaskWithContext(ctx context.Context, task iot_grpcapi.InitialTaskDescription) (taskID string, err error)

func (*Client) DeepPing

func (c *Client) DeepPing() error

func (*Client) DeepPingWithContext

func (c *Client) DeepPingWithContext(ctx context.Context) error

func (*Client) DeleteNodeData

func (c *Client) DeleteNodeData(input iot_grpcapi.DeleteNodeDataInput) (err error)

Delete Node data functions

func (*Client) DeleteNodeDataWithContext

func (c *Client) DeleteNodeDataWithContext(ctx context.Context, input iot_grpcapi.DeleteNodeDataInput) (err error)

func (*Client) DeleteTask

func (c *Client) DeleteTask(userID, taskID string) (err error)

func (*Client) DeleteTaskWithContext

func (c *Client) DeleteTaskWithContext(ctx context.Context, userID, taskID string) (err error)

func (*Client) Dial

func (c *Client) Dial(host, port string, opts ...grpc.DialOption) error

Dial creates a client connection to the given host with background context and no timeout

func (*Client) DialWithContext added in v1.7.4

func (c *Client) DialWithContext(ctx context.Context, host, port string, opts ...grpc.DialOption) (err error)

DialWithContext creates a client connection to the given host with context (for timeout and transaction id)

func (*Client) GetAllTasks

func (c *Client) GetAllTasks(userID string) (out []iot_grpcapi.TaskDescription, err error)

func (*Client) GetAllTasksWithContext

func (c *Client) GetAllTasksWithContext(ctx context.Context, userID string) (out []iot_grpcapi.TaskDescription, err error)

func (*Client) GetLatestNodeData

func (c *Client) GetLatestNodeData(input iot_grpcapi.GetLatestNodeDataInput) (*iot_grpcapi.NodeData, error)

func (*Client) GetLatestNodeDataWithContext

func (c *Client) GetLatestNodeDataWithContext(ctx context.Context, input iot_grpcapi.GetLatestNodeDataInput) (nodeData *iot_grpcapi.NodeData, err error)

func (*Client) GetMedia

func (c *Client) GetMedia(input iot_grpcapi.GetMediaInput) (iot_grpcapi.Media, error)

func (*Client) GetMediaWithContext

func (c *Client) GetMediaWithContext(ctx context.Context, input iot_grpcapi.GetMediaInput) (media iot_grpcapi.Media, err error)

func (*Client) GetNodeData

func (c *Client) GetNodeData(input iot_grpcapi.GetNodeDataInput) (out []iot_grpcapi.NodeData, err error)

func (*Client) GetNodeDataWithContext

func (c *Client) GetNodeDataWithContext(ctx context.Context, input iot_grpcapi.GetNodeDataInput) (out []iot_grpcapi.NodeData, err error)

func (*Client) GetNodeEventLog

func (c *Client) GetNodeEventLog(input iot_grpcapi.GetNodeEventLogInput) (output *iot_grpcapi.GetNodeEventLogOutput, err error)

func (*Client) GetNodeEventLogWithContext

func (c *Client) GetNodeEventLogWithContext(ctx context.Context, input iot_grpcapi.GetNodeEventLogInput) (output *iot_grpcapi.GetNodeEventLogOutput, err error)

func (*Client) GetTaskByLongId

func (c *Client) GetTaskByLongId(input int64) (output *iot_grpcapi.TaskDescription, err error)

func (*Client) GetTaskByLongIdWithContext

func (c *Client) GetTaskByLongIdWithContext(ctx context.Context, input int64) (output *iot_grpcapi.TaskDescription, err error)

func (*Client) GetTaskByUUID

func (c *Client) GetTaskByUUID(input string) (output *iot_grpcapi.TaskDescription, err error)

func (*Client) GetTaskByUUIDWithContext

func (c *Client) GetTaskByUUIDWithContext(ctx context.Context, input string) (output *iot_grpcapi.TaskDescription, err error)

func (*Client) GetTaskStream

func (c *Client) GetTaskStream(input iot_grpcapi.GetTaskStreamInput, dc chan<- iot_grpcapi.GetTaskStreamOutput) (err error)

func (*Client) GetTaskStreamWithContext

func (c *Client) GetTaskStreamWithContext(ctx context.Context, input iot_grpcapi.GetTaskStreamInput, dc chan<- iot_grpcapi.GetTaskStreamOutput) (err error)

func (*Client) GetTasksByStatus

func (c *Client) GetTasksByStatus(input iot_grpcapi.GetTasksByStatusInput) ([]*iot_grpcapi.TaskDescription, error)

func (*Client) GetTasksByStatusWithContext

func (c *Client) GetTasksByStatusWithContext(ctx context.Context, input iot_grpcapi.GetTasksByStatusInput) (tasks []*iot_grpcapi.TaskDescription, err error)

func (*Client) GetUncompletedTasks

func (c *Client) GetUncompletedTasks(userID string) (out []iot_grpcapi.TaskDescription, err error)

func (*Client) GetUncompletedTasksByHierarchy

func (c *Client) GetUncompletedTasksByHierarchy(nodeID string) (out []iot_grpcapi.TaskDescription, err error)

func (*Client) GetUncompletedTasksByHierarchyWithContext

func (c *Client) GetUncompletedTasksByHierarchyWithContext(ctx context.Context, nodeID string) (out []iot_grpcapi.TaskDescription, err error)

func (*Client) GetUncompletedTasksWithContext

func (c *Client) GetUncompletedTasksWithContext(ctx context.Context, userID string) (out []iot_grpcapi.TaskDescription, err error)

func (*Client) IngestNodeData

func (c *Client) IngestNodeData(input iot_grpcapi.IngestNodeDataInput) (err error)

func (*Client) IngestNodeDataWithContext

func (c *Client) IngestNodeDataWithContext(ctx context.Context, input iot_grpcapi.IngestNodeDataInput) (err error)

func (*Client) IngestNodesData

func (c *Client) IngestNodesData(input iot_grpcapi.IngestNodesDataInput) (err error)

IngestNodesData ingest nodes, this operation can success or fail. Fail means that no data is stored.

func (*Client) IngestNodesDataWithContext

func (c *Client) IngestNodesDataWithContext(ctx context.Context, input iot_grpcapi.IngestNodesDataInput) error

IngestNodesDataWithContext ingest nodes with context, this operation can success or fail. Fail means that no data is stored.

func (*Client) RequestGetMediaSignedURL

RequestGetMediaSignedURL if successful returns a url where media data can be accessed.

func (*Client) RequestGetMediaSignedURLWithContext

func (c *Client) RequestGetMediaSignedURLWithContext(ctx context.Context, in *iot_grpcapi.GetMediaSignedUrlInput) (*iot_grpcapi.GetMediaSignedUrlOutput, error)

RequestGetMediaSignedURLWithContext if successful returns a url where media data can be accessed.

func (*Client) RequestPutMediaSignedURL

RequestPutMediaSignedURL if successful returns a url where media data can be uploaded.

func (*Client) RequestPutMediaSignedURLWithContext

func (c *Client) RequestPutMediaSignedURLWithContext(ctx context.Context, in *iot_grpcapi.PutMediaSignedUrlInput) (*iot_grpcapi.PutMediaSignedUrlOutput, error)

RequestPutMediaSignedURLWithContext if successful returns a url where media data can be uploaded.

func (*Client) SetTaskCompleted

func (c *Client) SetTaskCompleted(userID, taskID string) (err error)

func (*Client) SetTaskCompletedWithContext

func (c *Client) SetTaskCompletedWithContext(ctx context.Context, userID, taskID string) (err error)

func (*Client) SetTaskStatus

func (c *Client) SetTaskStatus(input iot_grpcapi.SetTaskStatusInput) (err error)

SetTaskStatus will set the status of the task.

SetTaskStatusInput:
  task_id uuid (required)
  user_id uuid  (required)
  status TaskStatus (required)
  - allowed values: NOT_SENT, SENT, RECEIVED, IN_PROGRESS, COMPLETED
  updated_at int (optional)
  - UNIX timestamp in ms

func (*Client) SetTaskStatusWithContext

func (c *Client) SetTaskStatusWithContext(ctx context.Context, input iot_grpcapi.SetTaskStatusInput) (err error)

type IoTClient

type IoTClient interface {
	Dial(host, port string, opts ...grpc.DialOption) error
	DialWithContext(ctx context.Context, host, port string, opts ...grpc.DialOption) error
	Close()

	DeepPing() error
	DeepPingWithContext(ctx context.Context) error

	CreateTask(task iot_grpcapi.InitialTaskDescription) (string, error)
	CreateTaskWithContext(ctx context.Context, task iot_grpcapi.InitialTaskDescription) (string, error)

	DeleteTask(userID, taskID string) error
	DeleteTaskWithContext(ctx context.Context, userID, taskID string) error

	SetTaskCompleted(userID, taskID string) error
	SetTaskCompletedWithContext(ctx context.Context, userID, taskID string) error

	GetAllTasks(userID string) ([]iot_grpcapi.TaskDescription, error)
	GetAllTasksWithContext(ctx context.Context, userID string) ([]iot_grpcapi.TaskDescription, error)

	GetUncompletedTasks(userID string) ([]iot_grpcapi.TaskDescription, error)
	GetUncompletedTasksWithContext(ctx context.Context, userID string) ([]iot_grpcapi.TaskDescription, error)

	GetUncompletedTasksByHierarchy(nodeID string) (out []iot_grpcapi.TaskDescription, err error)
	GetUncompletedTasksByHierarchyWithContext(ctx context.Context, nodeID string) (out []iot_grpcapi.TaskDescription, err error)

	SetTaskStatus(input iot_grpcapi.SetTaskStatusInput) (err error)
	SetTaskStatusWithContext(ctx context.Context, input iot_grpcapi.SetTaskStatusInput) (err error)

	GetTaskStream(input iot_grpcapi.GetTaskStreamInput, dc chan<- iot_grpcapi.GetTaskStreamOutput) (err error)                                 // nolint: staticcheck
	GetTaskStreamWithContext(ctx context.Context, input iot_grpcapi.GetTaskStreamInput, dc chan<- iot_grpcapi.GetTaskStreamOutput) (err error) // nolint: staticcheck

	GetTasksByStatus(input iot_grpcapi.GetTasksByStatusInput) ([]*iot_grpcapi.TaskDescription, error)
	GetTasksByStatusWithContext(ctx context.Context, input iot_grpcapi.GetTasksByStatusInput) ([]*iot_grpcapi.TaskDescription, error)

	GetTaskByUUID(input string) (*iot_grpcapi.TaskDescription, error)
	GetTaskByUUIDWithContext(ctx context.Context, input string) (*iot_grpcapi.TaskDescription, error)

	GetTaskByLongId(input int64) (*iot_grpcapi.TaskDescription, error)
	GetTaskByLongIdWithContext(ctx context.Context, input int64) (*iot_grpcapi.TaskDescription, error)

	GetTasksModifiedSinceTimestamp(input iot_grpcapi.GetTasksModifiedSinceTimestampInput) (*iot_grpcapi.GetTasksModifiedSinceTimestampOutput, error)
	GetTasksModifiedSinceTimestampWithContext(ctx context.Context, input iot_grpcapi.GetTasksModifiedSinceTimestampInput) (*iot_grpcapi.GetTasksModifiedSinceTimestampOutput, error)

	IngestNodeData(input iot_grpcapi.IngestNodeDataInput) error
	IngestNodeDataWithContext(ctx context.Context, input iot_grpcapi.IngestNodeDataInput) error

	IngestNodesData(input iot_grpcapi.IngestNodesDataInput) error
	IngestNodesDataWithContext(ctx context.Context, input iot_grpcapi.IngestNodesDataInput) error

	GetLatestNodeData(input iot_grpcapi.GetLatestNodeDataInput) (*iot_grpcapi.NodeData, error)
	GetLatestNodeDataWithContext(ctx context.Context, input iot_grpcapi.GetLatestNodeDataInput) (*iot_grpcapi.NodeData, error)

	GetNodeData(input iot_grpcapi.GetNodeDataInput) ([]iot_grpcapi.NodeData, error)
	GetNodeDataWithContext(ctx context.Context, input iot_grpcapi.GetNodeDataInput) ([]iot_grpcapi.NodeData, error)

	GetMedia(input iot_grpcapi.GetMediaInput) (iot_grpcapi.Media, error)
	GetMediaWithContext(ctx context.Context, input iot_grpcapi.GetMediaInput) (iot_grpcapi.Media, error)

	RequestGetMediaSignedURL(in *iot_grpcapi.GetMediaSignedUrlInput) (*iot_grpcapi.GetMediaSignedUrlOutput, error)
	RequestGetMediaSignedURLWithContext(ctx context.Context, in *iot_grpcapi.GetMediaSignedUrlInput) (*iot_grpcapi.GetMediaSignedUrlOutput, error)

	RequestPutMediaSignedURL(in *iot_grpcapi.PutMediaSignedUrlInput) (*iot_grpcapi.PutMediaSignedUrlOutput, error)
	RequestPutMediaSignedURLWithContext(ctx context.Context, in *iot_grpcapi.PutMediaSignedUrlInput) (*iot_grpcapi.PutMediaSignedUrlOutput, error)

	DeleteNodeData(input iot_grpcapi.DeleteNodeDataInput) error
	DeleteNodeDataWithContext(ctx context.Context, input iot_grpcapi.DeleteNodeDataInput) error

	GetNodeEventLog(input iot_grpcapi.GetNodeEventLogInput) (*iot_grpcapi.GetNodeEventLogOutput, error)
	GetNodeEventLogWithContext(ctx context.Context, input iot_grpcapi.GetNodeEventLogInput) (*iot_grpcapi.GetNodeEventLogOutput, error)
}

func CreateClient

func CreateClient() IoTClient

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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