information

package
v0.0.0-...-d2cf98a Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "information"

ServiceName is the name of the service as defined in the design. This is the same value that is set in the endpoint request contexts under the ServiceKey key.

Variables

View Source
var MethodNames = [2]string{"device layout", "firmware statistics"}

MethodNames lists the service method names as defined in the design. These are the same values that are set in the endpoint request contexts under the MethodKey key.

Functions

func MakeBadRequest

func MakeBadRequest(err error) *goa.ServiceError

MakeBadRequest builds a goa.ServiceError from an error.

func MakeForbidden

func MakeForbidden(err error) *goa.ServiceError

MakeForbidden builds a goa.ServiceError from an error.

func MakeNotFound

func MakeNotFound(err error) *goa.ServiceError

MakeNotFound builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func NewDeviceLayoutEndpoint

func NewDeviceLayoutEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewDeviceLayoutEndpoint returns an endpoint function that calls the method "device layout" of service "information".

func NewFirmwareStatisticsEndpoint

func NewFirmwareStatisticsEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint

NewFirmwareStatisticsEndpoint returns an endpoint function that calls the method "firmware statistics" of service "information".

func NewViewedDeviceLayoutResponse

func NewViewedDeviceLayoutResponse(res *DeviceLayoutResponse, view string) *informationviews.DeviceLayoutResponse

NewViewedDeviceLayoutResponse initializes viewed result type DeviceLayoutResponse from result type DeviceLayoutResponse using the given view.

Types

type Auther

type Auther interface {
	// JWTAuth implements the authorization logic for the JWT security scheme.
	JWTAuth(ctx context.Context, token string, schema *security.JWTScheme) (context.Context, error)
}

Auther defines the authorization functions to be implemented by the service.

type Client

type Client struct {
	DeviceLayoutEndpoint       goa.Endpoint
	FirmwareStatisticsEndpoint goa.Endpoint
}

Client is the "information" service client.

func NewClient

func NewClient(deviceLayout, firmwareStatistics goa.Endpoint) *Client

NewClient initializes a "information" service client given the endpoints.

func (*Client) DeviceLayout

func (c *Client) DeviceLayout(ctx context.Context, p *DeviceLayoutPayload) (res *DeviceLayoutResponse, err error)

DeviceLayout calls the "device layout" endpoint of the "information" service.

func (*Client) FirmwareStatistics

func (c *Client) FirmwareStatistics(ctx context.Context, p *FirmwareStatisticsPayload) (res *FirmwareStatisticsResult, err error)

FirmwareStatistics calls the "firmware statistics" endpoint of the "information" service.

type DeviceLayoutPayload

type DeviceLayoutPayload struct {
	Auth     string
	DeviceID string
}

DeviceLayoutPayload is the payload type of the information service device layout method.

type DeviceLayoutResponse

type DeviceLayoutResponse struct {
	Configurations []*StationConfiguration
	Sensors        map[string][]*StationSensor
}

DeviceLayoutResponse is the result type of the information service device layout method.

func NewDeviceLayoutResponse

func NewDeviceLayoutResponse(vres *informationviews.DeviceLayoutResponse) *DeviceLayoutResponse

NewDeviceLayoutResponse initializes result type DeviceLayoutResponse from viewed result type DeviceLayoutResponse.

type Endpoints

type Endpoints struct {
	DeviceLayout       goa.Endpoint
	FirmwareStatistics goa.Endpoint
}

Endpoints wraps the "information" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "information" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "information" service endpoints.

type FirmwareStatisticsPayload

type FirmwareStatisticsPayload struct {
	Auth string
}

FirmwareStatisticsPayload is the payload type of the information service firmware statistics method.

type FirmwareStatisticsResult

type FirmwareStatisticsResult struct {
	Object interface{}
}

FirmwareStatisticsResult is the result type of the information service firmware statistics method.

type SensorRange

type SensorRange struct {
	Minimum float32
	Maximum float32
}

type SensorReading

type SensorReading struct {
	Last float32
	Time int64
}

type Service

type Service interface {
	// DeviceLayout implements device layout.
	DeviceLayout(context.Context, *DeviceLayoutPayload) (res *DeviceLayoutResponse, err error)
	// FirmwareStatistics implements firmware statistics.
	FirmwareStatistics(context.Context, *FirmwareStatisticsPayload) (res *FirmwareStatisticsResult, err error)
}

Service is the information service interface.

type StationConfiguration

type StationConfiguration struct {
	ID           int64
	Time         int64
	ProvisionID  int64
	MetaRecordID *int64
	SourceID     *int32
	Modules      []*StationModule
}

type StationModule

type StationModule struct {
	ID               int64
	HardwareID       *string
	HardwareIDBase64 *string
	MetaRecordID     *int64
	Name             string
	Label            *string
	Position         int32
	Flags            int32
	Internal         bool
	FullKey          string
	Sensors          []*StationSensor
	Meta             map[string]interface{}
}

type StationSensor

type StationSensor struct {
	Name          string
	UnitOfMeasure string
	Reading       *SensorReading
	Key           string
	FullKey       string
	Ranges        []*SensorRange
	Meta          map[string]interface{}
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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