api

package
v3.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 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 Client

type Client struct {
	Tokens  *Tokens
	Uplinks *Uplinks
	// contains filtered or unexported fields
}

Client is an API client for the LoRa Cloud Device Management v1 service.

func New

func New(cl *http.Client, opts ...Option) (*Client, error)

New creates a new Client with the given options.

func (*Client) Do

func (c *Client) Do(method, category, entity, operation string, body io.Reader, queryParams ...queryParam) (*http.Response, error)

Do executes a new HTTP request with the given parameters and body and returns the response.

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an option for the API client.

func WithToken

func WithToken(token string) Option

WithToken uses the given authentication token in the client.

type OptionFunc

type OptionFunc func(*Client)

OptionFunc is an Option implemented as a function.

type Tokens

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

Tokens is an API client for the Token Management API.

func (*Tokens) Add

func (t *Tokens) Add(name string, capabilities ...string) (*objects.TokenInfo, error)

Add creates a token with the given name and capabilities.

func (*Tokens) Get

func (t *Tokens) Get(token string) (*objects.TokenInfo, error)

Get returns the contents of the given token.

func (*Tokens) List

func (t *Tokens) List() ([]objects.TokenInfo, error)

List returns the tokens.

func (*Tokens) Remove

func (t *Tokens) Remove(token string) error

Remove removes the given token.

func (*Tokens) Update

func (t *Tokens) Update(token, newName string, renew bool) (*objects.TokenInfo, error)

Update changes the name of the given token and optionally regenerates it.

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

Uplinks is an API client for the Uplink API.

func (*Uplinks) Send

Send sends the given uplink to the Device Management service.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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