handlerclient

package
v0.0.0-...-228f33a Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 11 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ManagerClient

type ManagerClient struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ManagerClient is used to manage applications and devices on a handler

func NewManagerClient

func NewManagerClient(conn *grpc.ClientConn, accessToken string) (*ManagerClient, error)

NewManagerClient returns a new ManagerClient for a handler on the given conn that accepts the given access token

func (*ManagerClient) Close

func (h *ManagerClient) Close() error

Close closes the client

func (*ManagerClient) DeleteApplication

func (h *ManagerClient) DeleteApplication(appID string) error

DeleteApplication deletes an application and all its devices from the Handler

func (*ManagerClient) DeleteDevice

func (h *ManagerClient) DeleteDevice(appID string, devID string) error

DeleteDevice deletes a device from the Handler

func (*ManagerClient) DryDownlinkWithFields

func (h *ManagerClient) DryDownlinkWithFields(fields map[string]interface{}, app *Application, port uint32) (*DryDownlinkResult, error)

DryDownlinkWithFields transforms the downlink fields with the payload functions provided in app.

func (*ManagerClient) DryDownlinkWithPayload

func (h *ManagerClient) DryDownlinkWithPayload(payload []byte, app *Application, port uint32) (*DryDownlinkResult, error)

DryDownlinkWithPayload transforms the downlink payload with the payload functions provided in app.

func (h *ManagerClient) DryUplink(payload []byte, app *Application, port uint32) (*DryUplinkResult, error)

DryUplink transforms the uplink payload with the payload functions provided in the app..

func (*ManagerClient) GetApplication

func (h *ManagerClient) GetApplication(appID string) (*Application, error)

GetApplication retrieves an application from the Handler

func (*ManagerClient) GetContext

func (h *ManagerClient) GetContext() context.Context

GetContext returns a new context with authentication

func (*ManagerClient) GetContextWithLimitAndOffset

func (h *ManagerClient) GetContextWithLimitAndOffset(limit, offset int) context.Context

GetContextWithLimitAndOffset returns a new context with authentication, plus limit and offset for pagination

func (*ManagerClient) GetDevAddr

func (h *ManagerClient) GetDevAddr(constraints ...string) (types.DevAddr, error)

GetDevAddr requests a random device address with the given constraints

func (*ManagerClient) GetDevice

func (h *ManagerClient) GetDevice(appID string, devID string) (*Device, error)

GetDevice retrieves a device from the Handler

func (*ManagerClient) GetDevicesForApplication

func (h *ManagerClient) GetDevicesForApplication(appID string, limit, offset int) (devices []*Device, err error)

GetDevicesForApplication retrieves all devices for an application from the Handler. Pass a limit to indicate the maximum number of results you want to receive, and the offset to indicate how many results should be skipped.

func (*ManagerClient) RegisterApplication

func (h *ManagerClient) RegisterApplication(appID string) error

RegisterApplication registers an application on the Handler

func (*ManagerClient) SetApplication

func (h *ManagerClient) SetApplication(in *Application) error

SetApplication sets an application on the Handler

func (*ManagerClient) SetDevice

func (h *ManagerClient) SetDevice(in *Device) error

SetDevice sets a device on the Handler

func (*ManagerClient) SetID

func (h *ManagerClient) SetID(id string)

SetID sets the ID of this client

func (h *ManagerClient) SimulateUplink(appID string, devID string, port uint32, payload []byte) error

SimulateUplink simulates an uplink message

func (*ManagerClient) UpdateAccessToken

func (h *ManagerClient) UpdateAccessToken(accessToken string)

UpdateAccessToken updates the access token that is used for running commands

Jump to

Keyboard shortcuts

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