client

package
v0.0.0-...-913e669 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConflict = fmt.Errorf("conflict")
View Source
var ErrNotFound = fmt.Errorf("not found")
View Source
var ErrUnauthorized = fmt.Errorf("unauthorized")

Functions

This section is empty.

Types

type ApiResponse

type ApiResponse struct {
	Meta     *Meta           `json:"meta,omitempty"`
	Data     json.RawMessage `json:"data"`
	Links    *Links          `json:"links,omitempty"`
	Included []Resource      `json:"included,omitempty"`
}

type Client

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

func NewClient

func NewClient(devmgmt, things, admin, alarms, measurement string) *Client

func (*Client) AdminURL

func (c *Client) AdminURL() string

func (*Client) AlarmsURL

func (c *Client) AlarmsURL() string

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, baseURL string) error

func (*Client) DeviceManagementURL

func (c *Client) DeviceManagementURL() string

func (*Client) Get

func (c *Client) Get(ctx context.Context, baseURL, path string, params url.Values) (*ApiResponse, error)

func (*Client) MeasurementURL

func (c *Client) MeasurementURL() string

func (*Client) Patch

func (c *Client) Patch(ctx context.Context, baseURL, id string, body []byte) error

func (*Client) Post

func (c *Client) Post(ctx context.Context, baseURL string, body []byte) error

func (*Client) Put

func (c *Client) Put(ctx context.Context, baseURL string, body []byte) error

func (*Client) SensorsManagementURL

func (c *Client) SensorsManagementURL() string

func (*Client) ThingManagementURL

func (c *Client) ThingManagementURL() string

type InputParam

type InputParam func(v *url.Values)

func WithAfter

func WithAfter(timeAt time.Time) InputParam

func WithAggrMethods

func WithAggrMethods(methods ...string) InputParam

func WithBoolValue

func WithBoolValue(boolValue bool) InputParam

func WithLastN

func WithLastN(lastN bool) InputParam

func WithLimit

func WithLimit(limit int) InputParam

func WithReverse

func WithReverse(reverse bool) InputParam

func WithTimeRel

func WithTimeRel(timeRel string, timeAt, endTimeAt time.Time) InputParam

func WithTimeUnit

func WithTimeUnit(timeUnit string) InputParam
type Links struct {
	Self  *string `json:"self,omitempty"`
	First *string `json:"first,omitempty"`
	Prev  *string `json:"prev,omitempty"`
	Next  *string `json:"next,omitempty"`
	Last  *string `json:"last,omitempty"`
}

type Location

type Location struct {
	Latitude  float64 `json:"latitude,omitempty"`
	Longitude float64 `json:"longitude,omitempty"`
}

type Meta

type Meta struct {
	TotalRecords uint64  `json:"totalRecords"`
	Offset       *uint64 `json:"offset,omitempty"`
	Limit        *uint64 `json:"limit,omitempty"`
	Count        uint64  `json:"count"`
}

type Metadata

type Metadata struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

type Resource

type Resource struct {
	ID   string `json:"id"`
	Type string `json:"type"`
}

Jump to

Keyboard shortcuts

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