Categorygithub.com/lab5e/spanclient-go/v4
modulepackage
4.1.4
Repository: https://github.com/lab5e/spanclient-go.git
Documentation: pkg.go.dev

# README

Go API client for spanclient

API for device, collection, output and firmware management

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 4.1.3 factual-kahlil
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://lab5e.com/span

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context
go get github.com/antihax/optional

Put the package under your project folder and add the following in import:

import "./spanclient"

Documentation for API Endpoints

All URIs are relative to https://api.lab5e.com/span

ClassMethodHTTP requestDescription
CollectionsApiBroadcastMessagePost /collections/{collectionId}/toBroadcast message
CollectionsApiCreateCollectionPost /collectionsCreate collection
CollectionsApiDeleteCollectionDelete /collections/{collectionId}Delete collection
CollectionsApiListCollectionDataGet /collections/{collectionId}/dataGet payloads
CollectionsApiListCollectionsGet /collectionsList collections
CollectionsApiRetrieveCollectionGet /collections/{collectionId}Retrieve collection
CollectionsApiUpdateCollectionPatch /collections/{collectionId}Update collection
DatadumpApiDataDumpPost /datadumpData dump
DevicesApiCreateDevicePost /collections/{collectionId}/devicesCreate device
DevicesApiDeleteDeviceDelete /collections/{collectionId}/devices/{deviceId}Remove device
DevicesApiListDeviceDataGet /collections/{collectionId}/devices/{deviceId}/dataGet payloads
DevicesApiListDevicesGet /collections/{collectionId}/devicesList devices
DevicesApiRetrieveDeviceGet /collections/{collectionId}/devices/{deviceId}Retrieve device
DevicesApiSendMessagePost /collections/{collectionId}/devices/{deviceId}/toSend message
DevicesApiUpdateDevicePatch /collections/{existingCollectionId}/devices/{deviceId}Update device
FotaApiClearFirmwareErrorDelete /collections/{collectionId}/devices/{deviceId}/fwerrorClear FOTA error
FotaApiCreateFirmwarePost /collections/{collectionId}/firmwareCreate firmware
FotaApiDeleteFirmwareDelete /collections/{collectionId}/firmware/{imageId}Delete firmware
FotaApiFirmwareUsagePatch /collections/{collectionId}/firmware/{imageId}/usageFirmware usage
FotaApiListFirmwareGet /collections/{collectionId}/firmwareList firmware
FotaApiRetrieveFirmwareGet /collections/{collectionId}/firmware/{imageId}Retrieve firmware
FotaApiUpdateFirmwarePatch /collections/{collectionId}/firmware/{imageId}Update firmware
OutputsApiCreateOutputPost /collections/{collectionId}/outputsCreate output
OutputsApiDeleteOutputDelete /collections/{collectionId}/outputs/{outputId}Delete output
OutputsApiListOutputsGet /collections/{collectionId}/outputsList outputs
OutputsApiLogsGet /collections/{collectionId}/outputs/{outputId}/logsOutput logs
OutputsApiRetrieveOutputGet /collections/{collectionId}/outputs/{outputId}Retrieve output
OutputsApiStatusGet /collections/{collectionId}/outputs/{outputId}/statusOutput status
OutputsApiUpdateOutputPatch /collections/{collectionId}/outputs/{outputId}Update output
SystemApiGetSystemInfoGet /systemSystem information

Documentation For Models

Documentation For Authorization

APIToken

  • Type: API key

Example

auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{
    Key: "APIKEY",
    Prefix: "Bearer", // Omit if not necessary.
})
r, err := client.Service.Operation(auth, args)

Author

[email protected]

# Packages

No description provided by the author

# Functions

CacheExpires helper function to determine remaining time before repeating a request.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResonse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewAuthContext is a convenience method to create an authentication context with an API key.
NewCollectionDataStream creates a live data stream for devices in a collection.
NewConfiguration returns a new Configuration object.
NewDeviceDataStream creates a live data stream for a single device.

# Constants

List of CollectionFirmwareFirmwareManagement.
List of OutputDataMessageOutputMessageType.
List of CollectionFirmwareFirmwareManagement.
List of CollectionFirmwareFirmwareManagement.
List of OutputType.
List of OutputDataMessageOutputMessageType.
List of OutputType.
List of OutputType.
List of OutputType.
List of OutputDataMessageOutputMessageType.
List of CollectionFirmwareFirmwareManagement.
List of OutputType.

# Variables

ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKey takes an APIKey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.

# Structs

APIClient manages communication with the The Span API API v4.1.3 factual-kahlil In most cases there should be only one, shared, APIClient.
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
APIResponse stores the API response returned by the server.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
CoApMetadata struct for CoApMetadata.
Collection struct for Collection.
CollectionFirmware struct for CollectionFirmware.
Configuration stores the configuration of the API client.
CreateFirmwareRequest struct for CreateFirmwareRequest.
DataDumpResponse struct for DataDumpResponse.
Device struct for Device.
DumpedCollection struct for DumpedCollection.
DumpedDevice struct for DumpedDevice.
FieldMask struct for FieldMask.
Firmware Firmware images aren't served back out through the API, only the metadata.
FirmwareMetadata Metadata about firmware on devices.
FirmwareUsageResponse struct for FirmwareUsageResponse.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
ListCollectionDataOpts Optional parameters for the method 'ListCollectionData'.
ListCollectionResponse Collection list.
ListDataResponse struct for ListDataResponse.
ListDeviceDataOpts Optional parameters for the method 'ListDeviceData'.
ListDevicesResponse struct for ListDevicesResponse.
ListFirmwareResponse struct for ListFirmwareResponse.
ListOutputResponse struct for ListOutputResponse.
MessageSendResult struct for MessageSendResult.
MultiSendMessageResponse Broadcast message result.
NetworkMetadata Network metadata for devices.
Output struct for Output.
OutputConfig Output configuration.
OutputDataMessage The output data message contains payload plus metadata for a payload received from a device.
OutputLogEntry struct for OutputLogEntry.
OutputLogs struct for OutputLogs.
OutputStatus struct for OutputStatus.
ProtobufAny `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message.
RuntimeError struct for RuntimeError.
RuntimeStreamError struct for RuntimeStreamError.
SendMessageRequest struct for SendMessageRequest.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
SystemInfoResponse struct for SystemInfoResponse.
UdpMetadata struct for UdpMetadata.
UpdateDeviceRequest struct for UpdateDeviceRequest.

# Interfaces

DataStream is a stream of data from the Span service.

# Type aliases

CollectionFirmwareFirmwareManagement The firmware management settings for a collection can either be \"disabled\", ie there is no firmware management for this collection, \"collection\"; devices are managed through the settings on the collection or \"device\" where each device is configured individual.
CollectionsApiService CollectionsApi service.
DatadumpApiService DatadumpApi service.
DevicesApiService DevicesApi service.
FotaApiService FotaApi service.
OutputDataMessageOutputMessageType the model 'OutputDataMessageOutputMessageType'.
OutputsApiService OutputsApi service.
OutputType the model 'OutputType'.
SystemApiService SystemApi service.