station

package
v0.0.0-...-b9360c4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceName = "station"

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 = [15]string{"add", "get", "transfer", "default photo", "update", "list mine", "list project", "list associated", "list project associated", "download photo", "list all", "delete", "admin search", "progress", "update module"}

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 MakeStationOwnerConflict

func MakeStationOwnerConflict(err error) *goa.ServiceError

MakeStationOwnerConflict builds a goa.ServiceError from an error.

func MakeUnauthorized

func MakeUnauthorized(err error) *goa.ServiceError

MakeUnauthorized builds a goa.ServiceError from an error.

func NewAddEndpoint

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

NewAddEndpoint returns an endpoint function that calls the method "add" of service "station".

func NewAdminSearchEndpoint

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

NewAdminSearchEndpoint returns an endpoint function that calls the method "admin search" of service "station".

func NewDefaultPhotoEndpoint

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

NewDefaultPhotoEndpoint returns an endpoint function that calls the method "default photo" of service "station".

func NewDeleteEndpoint

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

NewDeleteEndpoint returns an endpoint function that calls the method "delete" of service "station".

func NewDownloadPhotoEndpoint

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

NewDownloadPhotoEndpoint returns an endpoint function that calls the method "download photo" of service "station".

func NewGetEndpoint

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

NewGetEndpoint returns an endpoint function that calls the method "get" of service "station".

func NewListAllEndpoint

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

NewListAllEndpoint returns an endpoint function that calls the method "list all" of service "station".

func NewListAssociatedEndpoint

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

NewListAssociatedEndpoint returns an endpoint function that calls the method "list associated" of service "station".

func NewListMineEndpoint

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

NewListMineEndpoint returns an endpoint function that calls the method "list mine" of service "station".

func NewListProjectAssociatedEndpoint

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

NewListProjectAssociatedEndpoint returns an endpoint function that calls the method "list project associated" of service "station".

func NewListProjectEndpoint

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

NewListProjectEndpoint returns an endpoint function that calls the method "list project" of service "station".

func NewProgressEndpoint

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

NewProgressEndpoint returns an endpoint function that calls the method "progress" of service "station".

func NewTransferEndpoint

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

NewTransferEndpoint returns an endpoint function that calls the method "transfer" of service "station".

func NewUpdateEndpoint

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

NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "station".

func NewUpdateModuleEndpoint

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

NewUpdateModuleEndpoint returns an endpoint function that calls the method "update module" of service "station".

func NewViewedAssociatedStations

func NewViewedAssociatedStations(res *AssociatedStations, view string) *stationviews.AssociatedStations

NewViewedAssociatedStations initializes viewed result type AssociatedStations from result type AssociatedStations using the given view.

func NewViewedDownloadedPhoto

func NewViewedDownloadedPhoto(res *DownloadedPhoto, view string) *stationviews.DownloadedPhoto

NewViewedDownloadedPhoto initializes viewed result type DownloadedPhoto from result type DownloadedPhoto using the given view.

func NewViewedPageOfStations

func NewViewedPageOfStations(res *PageOfStations, view string) *stationviews.PageOfStations

NewViewedPageOfStations initializes viewed result type PageOfStations from result type PageOfStations using the given view.

func NewViewedStationFull

func NewViewedStationFull(res *StationFull, view string) *stationviews.StationFull

NewViewedStationFull initializes viewed result type StationFull from result type StationFull using the given view.

func NewViewedStationProgress

func NewViewedStationProgress(res *StationProgress, view string) *stationviews.StationProgress

NewViewedStationProgress initializes viewed result type StationProgress from result type StationProgress using the given view.

func NewViewedStationsFull

func NewViewedStationsFull(res *StationsFull, view string) *stationviews.StationsFull

NewViewedStationsFull initializes viewed result type StationsFull from result type StationsFull using the given view.

Types

type AddPayload

type AddPayload struct {
	Auth         string
	Name         string
	DeviceID     string
	LocationName *string
	StatusPb     *string
	Description  *string
}

AddPayload is the payload type of the station service add method.

type AdminSearchPayload

type AdminSearchPayload struct {
	Auth  string
	Query string
}

AdminSearchPayload is the payload type of the station service admin search method.

type AssociatedStation

type AssociatedStation struct {
	Station  *StationFull
	Project  []*AssociatedViaProject
	Location []*AssociatedViaLocation
	Manual   []*AssociatedViaManual
	Hidden   bool
}

type AssociatedStationCollection

type AssociatedStationCollection []*AssociatedStation

type AssociatedStations

type AssociatedStations struct {
	Stations AssociatedStationCollection
}

AssociatedStations is the result type of the station service list associated method.

func NewAssociatedStations

func NewAssociatedStations(vres *stationviews.AssociatedStations) *AssociatedStations

NewAssociatedStations initializes result type AssociatedStations from viewed result type AssociatedStations.

type AssociatedViaLocation

type AssociatedViaLocation struct {
	StationID int32
	Distance  float32
}

type AssociatedViaManual

type AssociatedViaManual struct {
	OtherStationID int32
	Priority       int32
}

type AssociatedViaProject

type AssociatedViaProject struct {
	ID int32
}

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 {
	AddEndpoint                   goa.Endpoint
	GetEndpoint                   goa.Endpoint
	TransferEndpoint              goa.Endpoint
	DefaultPhotoEndpoint          goa.Endpoint
	UpdateEndpoint                goa.Endpoint
	ListMineEndpoint              goa.Endpoint
	ListProjectEndpoint           goa.Endpoint
	ListAssociatedEndpoint        goa.Endpoint
	ListProjectAssociatedEndpoint goa.Endpoint
	DownloadPhotoEndpoint         goa.Endpoint
	ListAllEndpoint               goa.Endpoint
	DeleteEndpoint                goa.Endpoint
	AdminSearchEndpoint           goa.Endpoint
	ProgressEndpoint              goa.Endpoint
	UpdateModuleEndpoint          goa.Endpoint
}

Client is the "station" service client.

func NewClient

func NewClient(add, get, transfer, defaultPhoto, update, listMine, listProject, listAssociated, listProjectAssociated, downloadPhoto, listAll, delete_, adminSearch, progress, updateModule goa.Endpoint) *Client

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

func (*Client) Add

func (c *Client) Add(ctx context.Context, p *AddPayload) (res *StationFull, err error)

Add calls the "add" endpoint of the "station" service.

func (*Client) AdminSearch

func (c *Client) AdminSearch(ctx context.Context, p *AdminSearchPayload) (res *PageOfStations, err error)

AdminSearch calls the "admin search" endpoint of the "station" service.

func (*Client) DefaultPhoto

func (c *Client) DefaultPhoto(ctx context.Context, p *DefaultPhotoPayload) (err error)

DefaultPhoto calls the "default photo" endpoint of the "station" service.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, p *DeletePayload) (err error)

Delete calls the "delete" endpoint of the "station" service.

func (*Client) DownloadPhoto

func (c *Client) DownloadPhoto(ctx context.Context, p *DownloadPhotoPayload) (res *DownloadedPhoto, err error)

DownloadPhoto calls the "download photo" endpoint of the "station" service.

func (*Client) Get

func (c *Client) Get(ctx context.Context, p *GetPayload) (res *StationFull, err error)

Get calls the "get" endpoint of the "station" service.

func (*Client) ListAll

func (c *Client) ListAll(ctx context.Context, p *ListAllPayload) (res *PageOfStations, err error)

ListAll calls the "list all" endpoint of the "station" service.

func (*Client) ListAssociated

func (c *Client) ListAssociated(ctx context.Context, p *ListAssociatedPayload) (res *AssociatedStations, err error)

ListAssociated calls the "list associated" endpoint of the "station" service.

func (*Client) ListMine

func (c *Client) ListMine(ctx context.Context, p *ListMinePayload) (res *StationsFull, err error)

ListMine calls the "list mine" endpoint of the "station" service.

func (*Client) ListProject

func (c *Client) ListProject(ctx context.Context, p *ListProjectPayload) (res *StationsFull, err error)

ListProject calls the "list project" endpoint of the "station" service.

func (*Client) ListProjectAssociated

func (c *Client) ListProjectAssociated(ctx context.Context, p *ListProjectAssociatedPayload) (res *AssociatedStations, err error)

ListProjectAssociated calls the "list project associated" endpoint of the "station" service.

func (*Client) Progress

func (c *Client) Progress(ctx context.Context, p *ProgressPayload) (res *StationProgress, err error)

Progress calls the "progress" endpoint of the "station" service.

func (*Client) Transfer

func (c *Client) Transfer(ctx context.Context, p *TransferPayload) (err error)

Transfer calls the "transfer" endpoint of the "station" service.

func (*Client) Update

func (c *Client) Update(ctx context.Context, p *UpdatePayload) (res *StationFull, err error)

Update calls the "update" endpoint of the "station" service.

func (*Client) UpdateModule

func (c *Client) UpdateModule(ctx context.Context, p *UpdateModulePayload) (res *StationFull, err error)

UpdateModule calls the "update module" endpoint of the "station" service.

type DefaultPhotoPayload

type DefaultPhotoPayload struct {
	Auth    *string
	ID      int32
	PhotoID int32
}

DefaultPhotoPayload is the payload type of the station service default photo method.

type DeletePayload

type DeletePayload struct {
	Auth      string
	StationID int32
}

DeletePayload is the payload type of the station service delete method.

type DownloadPhotoPayload

type DownloadPhotoPayload struct {
	Auth        *string
	StationID   int32
	Size        *int32
	IfNoneMatch *string
}

DownloadPhotoPayload is the payload type of the station service download photo method.

type DownloadedPhoto

type DownloadedPhoto struct {
	Length      int64
	ContentType string
	Etag        string
	Body        []byte
}

DownloadedPhoto is the result type of the station service download photo method.

func NewDownloadedPhoto

func NewDownloadedPhoto(vres *stationviews.DownloadedPhoto) *DownloadedPhoto

NewDownloadedPhoto initializes result type DownloadedPhoto from viewed result type DownloadedPhoto.

type Endpoints

type Endpoints struct {
	Add                   goa.Endpoint
	Get                   goa.Endpoint
	Transfer              goa.Endpoint
	DefaultPhoto          goa.Endpoint
	Update                goa.Endpoint
	ListMine              goa.Endpoint
	ListProject           goa.Endpoint
	ListAssociated        goa.Endpoint
	ListProjectAssociated goa.Endpoint
	DownloadPhoto         goa.Endpoint
	ListAll               goa.Endpoint
	Delete                goa.Endpoint
	AdminSearch           goa.Endpoint
	Progress              goa.Endpoint
	UpdateModule          goa.Endpoint
}

Endpoints wraps the "station" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

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

type EssentialStation

type EssentialStation struct {
	ID                 int64
	DeviceID           string
	Name               string
	Owner              *StationOwner
	CreatedAt          int64
	UpdatedAt          int64
	RecordingStartedAt *int64
	MemoryUsed         *int32
	MemoryAvailable    *int32
	FirmwareNumber     *int32
	FirmwareTime       *int64
	Location           *StationLocation
	LastIngestionAt    *int64
}

type GetPayload

type GetPayload struct {
	Auth *string
	ID   int32
}

GetPayload is the payload type of the station service get method.

type ListAllPayload

type ListAllPayload struct {
	Auth     string
	Page     *int32
	PageSize *int32
	OwnerID  *int32
	Query    *string
	SortBy   *string
}

ListAllPayload is the payload type of the station service list all method.

type ListAssociatedPayload

type ListAssociatedPayload struct {
	Auth *string
	ID   int32
}

ListAssociatedPayload is the payload type of the station service list associated method.

type ListMinePayload

type ListMinePayload struct {
	Auth string
}

ListMinePayload is the payload type of the station service list mine method.

type ListProjectAssociatedPayload

type ListProjectAssociatedPayload struct {
	Auth      *string
	ProjectID int32
}

ListProjectAssociatedPayload is the payload type of the station service list project associated method.

type ListProjectPayload

type ListProjectPayload struct {
	Auth             *string
	ID               int32
	DisableFiltering *bool
}

ListProjectPayload is the payload type of the station service list project method.

type PageOfStations

type PageOfStations struct {
	Stations []*EssentialStation
	Total    int32
}

PageOfStations is the result type of the station service list all method.

func NewPageOfStations

func NewPageOfStations(vres *stationviews.PageOfStations) *PageOfStations

NewPageOfStations initializes result type PageOfStations from viewed result type PageOfStations.

type ProgressPayload

type ProgressPayload struct {
	Auth      string
	StationID int32
}

ProgressPayload is the payload type of the station service progress method.

type SensorRange

type SensorRange struct {
	Minimum float32
	Maximum float32
}

type SensorReading

type SensorReading struct {
	Last float32
	Time int64
}

type Service

type Service interface {
	// Add implements add.
	Add(context.Context, *AddPayload) (res *StationFull, err error)
	// Get implements get.
	Get(context.Context, *GetPayload) (res *StationFull, err error)
	// Transfer implements transfer.
	Transfer(context.Context, *TransferPayload) (err error)
	// DefaultPhoto implements default photo.
	DefaultPhoto(context.Context, *DefaultPhotoPayload) (err error)
	// Update implements update.
	Update(context.Context, *UpdatePayload) (res *StationFull, err error)
	// ListMine implements list mine.
	ListMine(context.Context, *ListMinePayload) (res *StationsFull, err error)
	// ListProject implements list project.
	ListProject(context.Context, *ListProjectPayload) (res *StationsFull, err error)
	// ListAssociated implements list associated.
	ListAssociated(context.Context, *ListAssociatedPayload) (res *AssociatedStations, err error)
	// ListProjectAssociated implements list project associated.
	ListProjectAssociated(context.Context, *ListProjectAssociatedPayload) (res *AssociatedStations, err error)
	// DownloadPhoto implements download photo.
	DownloadPhoto(context.Context, *DownloadPhotoPayload) (res *DownloadedPhoto, err error)
	// ListAll implements list all.
	ListAll(context.Context, *ListAllPayload) (res *PageOfStations, err error)
	// Delete implements delete.
	Delete(context.Context, *DeletePayload) (err error)
	// AdminSearch implements admin search.
	AdminSearch(context.Context, *AdminSearchPayload) (res *PageOfStations, err error)
	// Progress implements progress.
	Progress(context.Context, *ProgressPayload) (res *StationProgress, err error)
	// UpdateModule implements update module.
	UpdateModule(context.Context, *UpdateModulePayload) (res *StationFull, err error)
}

Service is the station service interface.

type StationConfiguration

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

type StationConfigurations

type StationConfigurations struct {
	All []*StationConfiguration
}

type StationDataSummary

type StationDataSummary struct {
	Start           int64
	End             int64
	NumberOfSamples int64
}

type StationFull

type StationFull struct {
	ID                 int32
	Name               string
	Model              *StationFullModel
	Owner              *StationOwner
	DeviceID           string
	Interestingness    *StationInterestingness
	Attributes         *StationProjectAttributes
	Uploads            []*StationUpload
	Photos             *StationPhotos
	ReadOnly           bool
	Status             *string
	Hidden             *bool
	Description        *string
	Battery            *float32
	RecordingStartedAt *int64
	MemoryUsed         *int32
	MemoryAvailable    *int32
	FirmwareNumber     *int32
	FirmwareTime       *int64
	Configurations     *StationConfigurations
	UpdatedAt          int64
	LastReadingAt      *int64
	LocationName       *string
	PlaceNameOther     *string
	PlaceNameNative    *string
	Location           *StationLocation
	SyncedAt           *int64
	IngestionAt        *int64
	Data               *StationDataSummary
}

StationFull is the result type of the station service add method.

func NewStationFull

func NewStationFull(vres *stationviews.StationFull) *StationFull

NewStationFull initializes result type StationFull from viewed result type StationFull.

type StationFullCollection

type StationFullCollection []*StationFull

type StationFullModel

type StationFullModel struct {
	Name                      string
	OnlyVisibleViaAssociation bool
}

type StationInterestingness

type StationInterestingness struct {
	Windows []*StationInterestingnessWindow
}

type StationInterestingnessWindow

type StationInterestingnessWindow struct {
	Seconds         int32
	Interestingness float64
	Value           float64
	Time            int64
}

type StationJob

type StationJob struct {
	Title       string
	StartedAt   int64
	CompletedAt *int64
	Progress    float32
}

type StationLocation

type StationLocation struct {
	Precise []float64
	Regions []*StationRegion
	URL     *string
}

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 StationOwner

type StationOwner struct {
	ID    int32
	Name  string
	Email *string
	Photo *UserPhoto
}

type StationPhotos

type StationPhotos struct {
	Small string
}

type StationProgress

type StationProgress struct {
	Jobs []*StationJob
}

StationProgress is the result type of the station service progress method.

func NewStationProgress

func NewStationProgress(vres *stationviews.StationProgress) *StationProgress

NewStationProgress initializes result type StationProgress from viewed result type StationProgress.

type StationProjectAttribute

type StationProjectAttribute struct {
	ProjectID   int32
	AttributeID int64
	Name        string
	StringValue string
	Priority    int32
}

type StationProjectAttributes

type StationProjectAttributes struct {
	Attributes []*StationProjectAttribute
}

type StationRegion

type StationRegion struct {
	Name  string
	Shape [][][]float64
}

type StationSensor

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

type StationUpload

type StationUpload struct {
	ID       int64
	Time     int64
	UploadID string
	Size     int64
	URL      string
	Type     string
	Blocks   []int64
}

type StationsFull

type StationsFull struct {
	Stations StationFullCollection
}

StationsFull is the result type of the station service list mine method.

func NewStationsFull

func NewStationsFull(vres *stationviews.StationsFull) *StationsFull

NewStationsFull initializes result type StationsFull from viewed result type StationsFull.

type TransferPayload

type TransferPayload struct {
	Auth    string
	ID      int32
	OwnerID int32
}

TransferPayload is the payload type of the station service transfer method.

type UpdateModulePayload

type UpdateModulePayload struct {
	Auth     string
	ID       int32
	ModuleID int32
	Label    string
}

UpdateModulePayload is the payload type of the station service update module method.

type UpdatePayload

type UpdatePayload struct {
	Auth         string
	ID           int32
	Name         string
	LocationName *string
	StatusPb     *string
	Description  *string
}

UpdatePayload is the payload type of the station service update method.

type UserPhoto

type UserPhoto struct {
	URL *string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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