Documentation ¶
Index ¶
- Constants
- Variables
- func MakeBadRequest(err error) *goa.ServiceError
- func MakeNotFound(err error) *goa.ServiceError
- func NewArchiveEndpoint(s Service) endpoint.Endpoint
- func NewReadEndpoint(s Service) endpoint.Endpoint
- func NewViewedArchiveMedia(res *ArchiveMedia, view string) *archiverviews.ArchiveMedia
- type ArchiveMedia
- type ArchivePayload
- type Client
- type Endpoints
- type ReadPayload
- type Service
Constants ¶
const ServiceName = "archiver"
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 = [2]string{"archive", "read"}
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 MakeNotFound ¶
func MakeNotFound(err error) *goa.ServiceError
MakeNotFound builds a goa.ServiceError from an error.
func NewArchiveEndpoint ¶
NewArchiveEndpoint returns an endpoint function that calls the method "archive" of service "archiver".
func NewReadEndpoint ¶
NewReadEndpoint returns an endpoint function that calls the method "read" of service "archiver".
func NewViewedArchiveMedia ¶
func NewViewedArchiveMedia(res *ArchiveMedia, view string) *archiverviews.ArchiveMedia
NewViewedArchiveMedia initializes viewed result type ArchiveMedia from result type ArchiveMedia using the given view.
Types ¶
type ArchiveMedia ¶
type ArchiveMedia struct { // The archive resouce href Href string // HTTP status Status int // HTTP response body content Body string }
ArchiveMedia is the result type of the archiver service archive method.
func NewArchiveMedia ¶
func NewArchiveMedia(vres *archiverviews.ArchiveMedia) *ArchiveMedia
NewArchiveMedia initializes result type ArchiveMedia from viewed result type ArchiveMedia.
type ArchivePayload ¶
ArchivePayload is the payload type of the archiver service archive method.
type Client ¶
Client is the "archiver" service client.
func (*Client) Archive ¶
func (c *Client) Archive(ctx context.Context, p *ArchivePayload) (res *ArchiveMedia, err error)
Archive calls the "archive" endpoint of the "archiver" service.
func (*Client) Read ¶
func (c *Client) Read(ctx context.Context, p *ReadPayload) (res *ArchiveMedia, err error)
Read calls the "read" endpoint of the "archiver" service. Read may return the following errors:
- "not_found" (type *goa.ServiceError)
- "bad_request" (type *goa.ServiceError)
- error: internal error
type Endpoints ¶
Endpoints wraps the "archiver" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "archiver" service with endpoints.
type ReadPayload ¶
type ReadPayload struct { // ID of archive ID int }
ReadPayload is the payload type of the archiver service read method.
type Service ¶
type Service interface { // Archive HTTP response Archive(context.Context, *ArchivePayload) (res *ArchiveMedia, err error) // Read HTTP response from archive Read(context.Context, *ReadPayload) (res *ArchiveMedia, err error) }
Service is the archiver service interface.