Documentation ¶
Index ¶
- Constants
- Variables
- func MakeBadRequest(err error) *goa.ServiceError
- func MakeForbidden(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func MakeUnauthorized(err error) *goa.ServiceError
- func NewCsvEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewDownloadEndpoint(s Service) goa.Endpoint
- func NewJSONLinesEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewListMineEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewStatusEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewViewedExportStatus(res *ExportStatus, view string) *exportviews.ExportStatus
- func NewViewedUserExports(res *UserExports, view string) *exportviews.UserExports
- type Auther
- type Client
- func (c *Client) Csv(ctx context.Context, p *CsvPayload) (res *CsvResult, err error)
- func (c *Client) Download(ctx context.Context, p *DownloadPayload) (res *DownloadResult, resp io.ReadCloser, err error)
- func (c *Client) JSONLines(ctx context.Context, p *JSONLinesPayload) (res *JSONLinesResult, err error)
- func (c *Client) ListMine(ctx context.Context, p *ListMinePayload) (res *UserExports, err error)
- func (c *Client) Status(ctx context.Context, p *StatusPayload) (res *ExportStatus, err error)
- type CsvPayload
- type CsvResult
- type DownloadPayload
- type DownloadResponseData
- type DownloadResult
- type Endpoints
- type ExportStatus
- type JSONLinesPayload
- type JSONLinesResult
- type ListMinePayload
- type Service
- type StatusPayload
- type UserExports
Constants ¶
const ServiceName = "export"
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 ¶
var MethodNames = [5]string{"list mine", "status", "download", "csv", "json lines"}
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 NewCsvEndpoint ¶
func NewCsvEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewCsvEndpoint returns an endpoint function that calls the method "csv" of service "export".
func NewDownloadEndpoint ¶
NewDownloadEndpoint returns an endpoint function that calls the method "download" of service "export".
func NewJSONLinesEndpoint ¶
func NewJSONLinesEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewJSONLinesEndpoint returns an endpoint function that calls the method "json lines" of service "export".
func NewListMineEndpoint ¶
func NewListMineEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewListMineEndpoint returns an endpoint function that calls the method "list mine" of service "export".
func NewStatusEndpoint ¶
func NewStatusEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewStatusEndpoint returns an endpoint function that calls the method "status" of service "export".
func NewViewedExportStatus ¶
func NewViewedExportStatus(res *ExportStatus, view string) *exportviews.ExportStatus
NewViewedExportStatus initializes viewed result type ExportStatus from result type ExportStatus using the given view.
func NewViewedUserExports ¶
func NewViewedUserExports(res *UserExports, view string) *exportviews.UserExports
NewViewedUserExports initializes viewed result type UserExports from result type UserExports 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 { ListMineEndpoint goa.Endpoint StatusEndpoint goa.Endpoint DownloadEndpoint goa.Endpoint CsvEndpoint goa.Endpoint JSONLinesEndpoint goa.Endpoint }
Client is the "export" service client.
func (*Client) Download ¶
func (c *Client) Download(ctx context.Context, p *DownloadPayload) (res *DownloadResult, resp io.ReadCloser, err error)
Download calls the "download" endpoint of the "export" service.
func (*Client) JSONLines ¶
func (c *Client) JSONLines(ctx context.Context, p *JSONLinesPayload) (res *JSONLinesResult, err error)
JSONLines calls the "json lines" endpoint of the "export" service.
func (*Client) ListMine ¶
func (c *Client) ListMine(ctx context.Context, p *ListMinePayload) (res *UserExports, err error)
ListMine calls the "list mine" endpoint of the "export" service.
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context, p *StatusPayload) (res *ExportStatus, err error)
Status calls the "status" endpoint of the "export" service.
type CsvPayload ¶
type CsvPayload struct { Auth string Start *int64 End *int64 Stations *string Sensors *string Resolution *int32 Aggregate *string Complete *bool Tail *int32 }
CsvPayload is the payload type of the export service csv method.
type CsvResult ¶
type CsvResult struct {
Location string
}
CsvResult is the result type of the export service csv method.
type DownloadPayload ¶
DownloadPayload is the payload type of the export service download method.
type DownloadResponseData ¶
type DownloadResponseData struct { // Result is the method result. Result *DownloadResult // Body streams the HTTP response body. Body io.ReadCloser }
DownloadResponseData holds both the result and the HTTP response body reader of the "download" method.
type DownloadResult ¶
DownloadResult is the result type of the export service download method.
type Endpoints ¶
type Endpoints struct { ListMine goa.Endpoint Status goa.Endpoint Download goa.Endpoint Csv goa.Endpoint JSONLines goa.Endpoint }
Endpoints wraps the "export" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "export" service with endpoints.
type ExportStatus ¶
type ExportStatus struct { ID int64 Token string CreatedAt int64 CompletedAt *int64 Format string Progress float32 Message *string StatusURL string DownloadURL *string Size *int32 Args interface{} }
ExportStatus is the result type of the export service status method.
func NewExportStatus ¶
func NewExportStatus(vres *exportviews.ExportStatus) *ExportStatus
NewExportStatus initializes result type ExportStatus from viewed result type ExportStatus.
type JSONLinesPayload ¶
type JSONLinesPayload struct { Auth string Start *int64 End *int64 Stations *string Sensors *string Resolution *int32 Aggregate *string Complete *bool Tail *int32 }
JSONLinesPayload is the payload type of the export service json lines method.
type JSONLinesResult ¶
type JSONLinesResult struct {
Location string
}
JSONLinesResult is the result type of the export service json lines method.
type ListMinePayload ¶
type ListMinePayload struct {
Auth string
}
ListMinePayload is the payload type of the export service list mine method.
type Service ¶
type Service interface { // ListMine implements list mine. ListMine(context.Context, *ListMinePayload) (res *UserExports, err error) // Status implements status. Status(context.Context, *StatusPayload) (res *ExportStatus, err error) // Download implements download. Download(context.Context, *DownloadPayload) (res *DownloadResult, body io.ReadCloser, err error) // Csv implements csv. Csv(context.Context, *CsvPayload) (res *CsvResult, err error) // JSONLines implements json lines. JSONLines(context.Context, *JSONLinesPayload) (res *JSONLinesResult, err error) }
Service is the export service interface.
type StatusPayload ¶
StatusPayload is the payload type of the export service status method.
type UserExports ¶
type UserExports struct {
Exports []*ExportStatus
}
UserExports is the result type of the export service list mine method.
func NewUserExports ¶
func NewUserExports(vres *exportviews.UserExports) *UserExports
NewUserExports initializes result type UserExports from viewed result type UserExports.