ttnclient

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKeyAuthenticator

type ApiKeyAuthenticator struct {
	ApiKey string
}

func (ApiKeyAuthenticator) Authenticate

func (a ApiKeyAuthenticator) Authenticate(request *http.Request) error

type Authenticator

type Authenticator interface {
	Authenticate(request *http.Request) error
}

type GatewayConnectionStats

type GatewayConnectionStats struct {
	ConnectedAt            time.Time      `json:"connected_at"`
	DisconnectedAt         time.Time      `json:"disconnected_at"`
	Protocol               string         `json:"protocol"`
	LastStatusReceivedAt   time.Time      `json:"last_status_received_at"`
	LastStatus             GatewayStatus  `json:"last_status"`
	LastUplinkReceivedAt   time.Time      `json:"last_uplink_received_at"`
	UplinkCount            string         `json:"uplink_count"`
	LastDownlinkReceivedAt time.Time      `json:"last_downlink_received_at"`
	DownlinkCount          string         `json:"downlink_count"`
	RoundTripTimes         RoundTripTimes `json:"round_trip_times"`
	SubBands               []SubBand      `json:"sub_bands"`
}

GatewayConnectionStats https://www.thethingsindustries.com/docs/reference/api/gateway_server/#message:GatewayConnectionStats

type GatewayStatus

type GatewayStatus struct {
	Time             time.Time              `json:"time"`
	BootTime         time.Time              `json:"boot_time"`
	Versions         map[string]string      `json:"versions"`
	AntennaLocations []Location             `json:"antenna_locations"`
	IP               []string               `json:"ip"`
	Metrics          map[string]float64     `json:"metrics"`
	Advanced         map[string]interface{} `json:"advanced"`
}

GatewayStatus https://www.thethingsindustries.com/docs/reference/api/gateway_server/#message:GatewayStatus

type Location

type Location struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
	Altitude  int32   `json:"altitude"`
	Accuracy  int32   `json:"accuracy"`

	// https://www.thethingsindustries.com/docs/reference/api/gateway_server/#enum:LocationSource
	Source string `json:"source"`
}

Location https://www.thethingsindustries.com/docs/reference/api/gateway_server/#message:Location

type RoundTripTimes

type RoundTripTimes struct {
	Min    time.Duration `json:"min"`
	Max    time.Duration `json:"max"`
	Median time.Duration `json:"median"`
	Count  uint32        `json:"count"`
}

RoundTripTimes https://www.thethingsindustries.com/docs/reference/api/gateway_server/#message:GatewayConnectionStats.RoundTripTimes

type SubBand

type SubBand struct {
	MinFrequency             string  `json:"min_frequency"`
	MaxFrequency             string  `json:"max_frequency"`
	DownlinkUtilizationLimit float64 `json:"downlink_utilization_limit"`
	DownlinkUtilization      float64 `json:"downlink_utilization,omitempty"`
}

SubBand https://www.thethingsindustries.com/docs/reference/api/gateway_server/#message:GatewayConnectionStats.RoundTripTimes

type TTNClient

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

func NewTTNClient

func NewTTNClient(baseUrl string, authenticator Authenticator) (*TTNClient, error)

func (*TTNClient) GetGatewayConnectionStats

func (client *TTNClient) GetGatewayConnectionStats(ctx context.Context, gatewayId string) (stats GatewayConnectionStats, err error)

Jump to

Keyboard shortcuts

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