api

package
v3.32.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultServerURL = func() *url.URL {
	parsed, err := url.Parse(defaultServerURL)
	if err != nil {
		panic(fmt.Sprintf("loradms: failed to parse base URL: %v", err))
	}
	return parsed
}()

DefaultServerURL is the default server URL for LoRa Cloud Device Management v1.

Functions

This section is empty.

Types

type Client

type Client struct {
	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(ctx context.Context, method, category, entity, operation string, body any) (*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 WithBaseURL added in v3.9.0

func WithBaseURL(baseURL *url.URL) Option

WithBaseURL uses the given base URL for the requests of the 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 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