collector

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Duration

type Duration struct {
	time.Duration
}

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

Go seems to have issues parsing time.Duration from a JSON: https://github.com/golang/go/issues/10275

type Gateway

type Gateway struct {
	IDs struct {
		GatewayID string `json:"gateway_id"`
		EUI       string `json:"eui"`
	} `json:"ids"`
	Name string `json:"name"`
}

type GatewayData

type GatewayData struct {
	GatewayID string
	Name      string
	Connected bool
	Stats     *GatewayStatsResponse
}

func GetInfo

func GetInfo(client *http.Client, uri string, apiKey string, logger log.Logger) ([]GatewayData, error)

type GatewayListResponse

type GatewayListResponse struct {
	Gateways []Gateway `json:"gateways"`
}

type GatewayStatsResponse

type GatewayStatsResponse struct {
	Code       int    `json:"code"`
	Protocol   string `json:"protocol"`
	LastStatus struct {
		Time     time.Time `json:"time"`
		Versions struct {
			GatewayServerVersion *string `json:"ttn-lw-gateway-server"`
			Firmware             *string `json:"firmware"`
			Package              *string `json:"package"`
			Platform             *string `json:"platform"`
			Station              *string `json:"station"`
		} `json:"versions"`
		IP      []string `json:"ip"`
		Metrics struct {
			Ackr float64 `json:"ackr"`
			TxIn float64 `json:"txin"`
			TxOk float64 `json:"txok"`
			RxIn float64 `json:"rxin"`
			RxOk float64 `json:"rxok"`
			RxFw float64 `json:"rxfw"`
		} `json:"metrics"`
	} `json:"last_status"`
	UplinkCount            string `json:"uplink_count"`
	DownlinkCount          string `json:"downlink_count"`
	TxAcknowledgementCount string `json:"tx_acknowledgement_count"`
	RoundTripTimes         *struct {
		Min    Duration `json:"min"`
		Max    Duration `json:"max"`
		Median Duration `json:"median"`
		Count  int64    `json:"count"`
	} `json:"round_trip_times"`
	GatewayRemoteAddress struct {
		IP string `json:"ip"`
	} `json:"gateway_remote_address"`
}

Jump to

Keyboard shortcuts

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