Documentation ¶
Index ¶
- type ApplicationListResponse
- type Client
- func (client Client) AllPackets(params ListAllPacketsParams) (r PacketListResponse, err error)
- func (client Client) CreateDevice(request DeviceCreateRequest) (r DeviceResponse, err error)
- func (client Client) DeleteDevice(eui string) (err error)
- func (client Client) ListDevicePackets(eui string, params ListDevicePacketsParams) (r PacketListResponse, err error)
- func (client Client) ListEUIsOfApplicationDevices(applicationId int) (r DevicesEuiListResponse, err error)
- func (client Client) ListEUIsOfDeviceClassDevices(deviceClassId int) (r DevicesEuiListResponse, err error)
- func (client Client) SendPacketToDevice(eui string, request SendPacketRequest) (r SendPacketResponse, err error)
- func (client *Client) SetDebugLog(val bool)
- func (client Client) ShowAllDevices() (r DeviceListResponse, err error)
- func (client Client) ShowApplications() (r ApplicationListResponse, err error)
- func (client Client) ShowDeviceByAddress(address string) (r DeviceResponse, err error)
- func (client Client) ShowDeviceByEui(eui string) (r DeviceResponse, err error)
- func (client Client) ShowDeviceClasses() (r DeviceClassesListResponse, err error)
- func (client Client) ShowSingleDeviceClass(deviceClassId int) (r DeviceClassResponse, err error)
- func (client Client) UpdateDevice(eui string, request DeviceUpdateRequest) (r DeviceResponse, err error)
- func (client Client) Url() (u *url.URL)
- type CreateDeviceRequest
- type Device
- type DeviceCalculateElement
- type DeviceClass
- type DeviceClassResponse
- type DeviceClassesListResponse
- type DeviceCreate
- type DeviceCreateRequest
- type DeviceListResponse
- type DeviceParseElement
- type DeviceResponse
- type DeviceUpdate
- type DeviceUpdateRequest
- type DeviceVariable
- type DeviceVariables
- type DevicesEuiListResponse
- type DigimondoReponse
- type Gwrx
- type ListAllPacketsParams
- type ListDevicePacketsParams
- type LocalTimeWithoutZone
- type Packet
- type PacketListResponse
- type SendPacketRequest
- type SendPacketResponse
- type UpdateDeviceRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationListResponse ¶
type ApplicationListResponse struct { DigimondoReponse Applications []struct { CreatedAt LocalTimeWithoutZone `json:"created_at"` // TODO: used in doc but not in example InsertedAt LocalTimeWithoutZone `json:"inserted_at"` // TODO: used in example but not in doc Description string `json:"description"` Eui string `json:"eui"` Id int `json:"id"` Name string `json:"name"` Sink interface{} `json:"sink"` UpdatedAt LocalTimeWithoutZone `json:"updated_at"` } `json:"applications,omitempty"` }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) AllPackets ¶
func (client Client) AllPackets(params ListAllPacketsParams) (r PacketListResponse, err error)
func (Client) CreateDevice ¶
func (client Client) CreateDevice(request DeviceCreateRequest) (r DeviceResponse, err error)
func (Client) DeleteDevice ¶
func (Client) ListDevicePackets ¶
func (client Client) ListDevicePackets(eui string, params ListDevicePacketsParams) (r PacketListResponse, err error)
func (Client) ListEUIsOfApplicationDevices ¶
func (client Client) ListEUIsOfApplicationDevices(applicationId int) (r DevicesEuiListResponse, err error)
func (Client) ListEUIsOfDeviceClassDevices ¶
func (client Client) ListEUIsOfDeviceClassDevices(deviceClassId int) (r DevicesEuiListResponse, err error)
func (Client) SendPacketToDevice ¶
func (client Client) SendPacketToDevice(eui string, request SendPacketRequest) (r SendPacketResponse, err error)
func (*Client) SetDebugLog ¶
func (Client) ShowAllDevices ¶
func (client Client) ShowAllDevices() (r DeviceListResponse, err error)
func (Client) ShowApplications ¶
func (client Client) ShowApplications() (r ApplicationListResponse, err error)
func (Client) ShowDeviceByAddress ¶
func (client Client) ShowDeviceByAddress(address string) (r DeviceResponse, err error)
func (Client) ShowDeviceByEui ¶
func (client Client) ShowDeviceByEui(eui string) (r DeviceResponse, err error)
func (Client) ShowDeviceClasses ¶
func (client Client) ShowDeviceClasses() (r DeviceClassesListResponse, err error)
func (Client) ShowSingleDeviceClass ¶
func (client Client) ShowSingleDeviceClass(deviceClassId int) (r DeviceClassResponse, err error)
func (Client) UpdateDevice ¶
func (client Client) UpdateDevice(eui string, request DeviceUpdateRequest) (r DeviceResponse, err error)
type CreateDeviceRequest ¶
type Device ¶
type Device struct { Address string `json:"address"` ApplicationKey string `json:"application_key"` ApplicationSessionKey string `json:"application_session_key"` Description string `json:"description"` Eui string `json:"eui"` NetworkSessionKey string `json:"network_session_key"` Otaa bool `json:"otaa"` Tags []string `json:"tags"` CreatedAt LocalTimeWithoutZone `json:"created_at"` DeviceClassId int `json:"device_class_id"` UpdatedAt LocalTimeWithoutZone `json:"updated_at"` }
type DeviceCalculateElement ¶
type DeviceClass ¶
type DeviceClass struct { Description string `json:"description"` Id int `json:"id"` InsertedAt LocalTimeWithoutZone `json:"inserted_at"` Name string `json:"name"` Script struct { Variables DeviceVariables `json:"variables"` ParseElements []DeviceParseElement `json:"parseElements"` CalculateElements []DeviceCalculateElement `json:"calculateElements"` } `json:"script"` UpdatedAt LocalTimeWithoutZone `json:"updated_at"` }
type DeviceClassResponse ¶
type DeviceClassResponse struct { DigimondoReponse DeviceClasses DeviceClass `json:"device_classes,omitempty"` // TODO: typo in doc of really 'device_classes'? }
type DeviceClassesListResponse ¶
type DeviceClassesListResponse struct { DigimondoReponse DeviceClasses []DeviceClass `json:"device_classes,omitempty"` }
type DeviceCreate ¶
type DeviceCreate struct { Address string `json:"address"` ApplicationKey string `json:"application_key"` ApplicationSessionKey string `json:"application_session_key"` Description string `json:"description"` Eui string `json:"eui"` NetworkSessionKey string `json:"network_session_key"` Otaa bool `json:"otaa"` Tags []string `json:"tags"` // TODO: valid? comma separated list in example. }
type DeviceCreateRequest ¶
type DeviceCreateRequest struct { Organization int `json:"organization"` Application int `json:"application"` Device DeviceCreate `json:"device"` }
type DeviceListResponse ¶
type DeviceListResponse struct { DigimondoReponse Devices []Device `json:"devices,omitempty"` }
type DeviceParseElement ¶
type DeviceResponse ¶
type DeviceResponse struct { DigimondoReponse Device Device `json:"device,omitempty"` }
type DeviceUpdate ¶
type DeviceUpdate struct { Address string `json:"address,omitempty"` ApplicationKey string `json:"application_key,omitempty"` ApplicationSessionKey string `json:"application_session_key,omitempty"` Description string `json:"description,omitempty"` Eui string `json:"eui,omitempty"` NetworkSessionKey string `json:"network_session_key,omitempty"` Otaa bool `json:"otaa,omitempty"` Tags []string `json:"tags,omitempty"` // TODO: valid? }
type DeviceUpdateRequest ¶
type DeviceUpdateRequest struct {
Device DeviceUpdate `json:"device"`
}
type DeviceVariable ¶
type DeviceVariables ¶
type DeviceVariables struct { Gps DeviceVariable `json:"gps"` BatteryLevel DeviceVariable `json:"batteryLevel"` Battery DeviceVariable `json:"battery"` }
type DevicesEuiListResponse ¶
type DevicesEuiListResponse struct { DigimondoReponse Devices []struct { Address string `json:"address"` Eui string `json:"eui"` Id string `json:"eui,omitempty"` // Used by "List EUIs of Devices" in device classes but not application } `json:"devices,omitempty"` }
type DigimondoReponse ¶
type DigimondoReponse struct {
Error string `json:"error,omitempty"`
}
type ListAllPacketsParams ¶
type ListAllPacketsParams struct { // (optional) when set to asc, it will return the oldest Packets first. When set to desc, it will return the most recent packets. Default is desc. Direction string // (optional) the amount Packets to be returned. Ordered by creation date, descending (unless otherwise specified through the direction parameter). Default value is 1 Maximum value is 100. LimitToLast int // (optional) the amount of most recent Packets to skip before returning Packets. Default value is 0. Offset int // (optional) only return the Payload, Timestamp and Device Address of the Packet. Default is false. Any other value will set this parameter to true. PayloadOnly bool // (optional) only return packets after this date. If this parameter is used and no limit_to_last value is supplied, limit_to_last will be set to 10. Default is the Unix Epoch Timestamp (meaning that no Packets will be omitted). Specify an ISO 8601 Date String here. ReceivedAfter *time.Time // (optional) do NOT show Packets from Devices that are not directly in the Organization that the API Key is registered for. SkipSuborgs bool }
func ListAllPacketsParamsFromQuery ¶
func ListAllPacketsParamsFromQuery(q url.Values) ListAllPacketsParams
type ListDevicePacketsParams ¶
type ListDevicePacketsParams struct { // (optional) when set to asc, it will return the oldest Packets first. When set to desc, it will return the most recent packets. Default is desc. Direction string // (optional) the amount Packets to be returned. Ordered by creation date, descending (unless otherwise specified through the direction parameter). Default value is 1 Maximum value is 100. LimitToLast int // (optional) the amount of most recent Packets to skip before returning Packets. Default value is 0. Offset int // (optional) only return the Payload, the parsed Payload (where applicable), the Timestamp and the Device Address of the Packet. Default is false. Any other value will set this parameter to true. PayloadOnly bool // (optional) only return packets after this date. If this parameter is used and no limit_to_last value is supplied, limit_to_last will be set to 10. Default is the Unix Epoch Timestamp (meaning that no Packets will be omitted). Specify an ISO 8601 Date String here. ReceivedAfter *time.Time }
func ListDevicePacketsParamsFromQuery ¶
func ListDevicePacketsParamsFromQuery(q url.Values) ListDevicePacketsParams
type LocalTimeWithoutZone ¶
func (*LocalTimeWithoutZone) MarshalJSON ¶
func (t *LocalTimeWithoutZone) MarshalJSON() ([]byte, error)
func (*LocalTimeWithoutZone) UnmarshalJSON ¶
func (t *LocalTimeWithoutZone) UnmarshalJSON(data []byte) (err error)
func (*LocalTimeWithoutZone) UnmarshalJSONXX ¶
func (t *LocalTimeWithoutZone) UnmarshalJSONXX(data []byte) error
type Packet ¶
type Packet struct { Ack bool `json:"ack"` Bandwidth int `json:"bandwidth"` Codr string `json:"codr"` Datr string `json:"datr"` // TODO: type? Not specified in docu DeviceEui string `json:"device_eui"` Fopts string `json:"fopts"` Fcnt int `json:"fcnt"` Freq float64 `json:"freq"` Gwrx []Gwrx `json:"gwrx,omitempty"` Modu string `json:"modu"` Mtype string `json:"mtype"` Parsed interface{} `json:"parsed"` Payload string `json:"payload"` PayloadEncrypted bool `json:"payload_encrypted"` Port int `json:"port"` ReceivedAt LocalTimeWithoutZone `json:"received_at"` Size int `json:"size"` SpreadingFactor int `json:"spreading_factor"` }
type PacketListResponse ¶
type PacketListResponse struct { DigimondoReponse Packets []Packet `json:"packets"` }
type SendPacketRequest ¶
type SendPacketResponse ¶
type SendPacketResponse struct { DigimondoReponse SentPacket struct { Fcnt int `json:"fcnt"` Id int `json:"id"` Payload string `json:"payload"` Port int `json:"port"` } `json:"sent_packet,omitempty"` }
type UpdateDeviceRequest ¶
type UpdateDeviceRequest struct { Device struct { Description string `json:"description"` } `json:"device"` }
Click to show internal directories.
Click to hide internal directories.