export

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
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

func NewDownloadEndpoint(s Service) goa.Endpoint

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 NewClient

func NewClient(listMine, status, download, csv, jSONLines goa.Endpoint) *Client

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

func (*Client) Csv

func (c *Client) Csv(ctx context.Context, p *CsvPayload) (res *CsvResult, err error)

Csv calls the "csv" endpoint of the "export" service.

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

type DownloadPayload struct {
	ID   string
	Auth string
}

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

type DownloadResult struct {
	Length             int64
	ContentType        string
	ContentDisposition string
}

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

func NewEndpoints(s Service) *Endpoints

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

func (*Endpoints) Use

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

Use applies the given middleware to all the "export" service 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

type StatusPayload struct {
	Auth string
	ID   string
}

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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