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 NewDeleteMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewDownloadMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewGetEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewUpdateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewUploadMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewViewedFieldNotes(res *FieldNotes, view string) *notesviews.FieldNotes
- func NewViewedNoteMedia(res *NoteMedia, view string) *notesviews.NoteMedia
- type Auther
- type Client
- func (c *Client) DeleteMedia(ctx context.Context, p *DeleteMediaPayload) (err error)
- func (c *Client) DownloadMedia(ctx context.Context, p *DownloadMediaPayload) (res *DownloadMediaResult, resp io.ReadCloser, err error)
- func (c *Client) Get(ctx context.Context, p *GetPayload) (res *FieldNotes, err error)
- func (c *Client) Update(ctx context.Context, p *UpdatePayload) (res *FieldNotes, err error)
- func (c *Client) UploadMedia(ctx context.Context, p *UploadMediaPayload, req io.ReadCloser) (res *NoteMedia, err error)
- type DeleteMediaPayload
- type DownloadMediaPayload
- type DownloadMediaResponseData
- type DownloadMediaResult
- type Endpoints
- type ExistingFieldNote
- type FieldNote
- type FieldNoteAuthor
- type FieldNoteStation
- type FieldNoteUpdate
- type FieldNotes
- type GetPayload
- type NewFieldNote
- type NoteMedia
- type Service
- type UpdatePayload
- type UploadMediaPayload
- type UploadMediaRequestData
Constants ¶
const ServiceName = "notes"
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{"update", "get", "download media", "upload media", "delete media"}
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 NewDeleteMediaEndpoint ¶
func NewDeleteMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewDeleteMediaEndpoint returns an endpoint function that calls the method "delete media" of service "notes".
func NewDownloadMediaEndpoint ¶
func NewDownloadMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewDownloadMediaEndpoint returns an endpoint function that calls the method "download media" of service "notes".
func NewGetEndpoint ¶
func NewGetEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewGetEndpoint returns an endpoint function that calls the method "get" of service "notes".
func NewUpdateEndpoint ¶
func NewUpdateEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewUpdateEndpoint returns an endpoint function that calls the method "update" of service "notes".
func NewUploadMediaEndpoint ¶
func NewUploadMediaEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewUploadMediaEndpoint returns an endpoint function that calls the method "upload media" of service "notes".
func NewViewedFieldNotes ¶
func NewViewedFieldNotes(res *FieldNotes, view string) *notesviews.FieldNotes
NewViewedFieldNotes initializes viewed result type FieldNotes from result type FieldNotes using the given view.
func NewViewedNoteMedia ¶
func NewViewedNoteMedia(res *NoteMedia, view string) *notesviews.NoteMedia
NewViewedNoteMedia initializes viewed result type NoteMedia from result type NoteMedia 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 { UpdateEndpoint goa.Endpoint GetEndpoint goa.Endpoint DownloadMediaEndpoint goa.Endpoint UploadMediaEndpoint goa.Endpoint DeleteMediaEndpoint goa.Endpoint }
Client is the "notes" service client.
func (*Client) DeleteMedia ¶
func (c *Client) DeleteMedia(ctx context.Context, p *DeleteMediaPayload) (err error)
DeleteMedia calls the "delete media" endpoint of the "notes" service.
func (*Client) DownloadMedia ¶
func (c *Client) DownloadMedia(ctx context.Context, p *DownloadMediaPayload) (res *DownloadMediaResult, resp io.ReadCloser, err error)
DownloadMedia calls the "download media" endpoint of the "notes" service.
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, p *GetPayload) (res *FieldNotes, err error)
Get calls the "get" endpoint of the "notes" service.
func (*Client) Update ¶
func (c *Client) Update(ctx context.Context, p *UpdatePayload) (res *FieldNotes, err error)
Update calls the "update" endpoint of the "notes" service.
func (*Client) UploadMedia ¶
func (c *Client) UploadMedia(ctx context.Context, p *UploadMediaPayload, req io.ReadCloser) (res *NoteMedia, err error)
UploadMedia calls the "upload media" endpoint of the "notes" service.
type DeleteMediaPayload ¶
DeleteMediaPayload is the payload type of the notes service delete media method.
type DownloadMediaPayload ¶
DownloadMediaPayload is the payload type of the notes service download media method.
type DownloadMediaResponseData ¶
type DownloadMediaResponseData struct { // Result is the method result. Result *DownloadMediaResult // Body streams the HTTP response body. Body io.ReadCloser }
DownloadMediaResponseData holds both the result and the HTTP response body reader of the "download media" method.
type DownloadMediaResult ¶
DownloadMediaResult is the result type of the notes service download media method.
type Endpoints ¶
type Endpoints struct { Update goa.Endpoint Get goa.Endpoint DownloadMedia goa.Endpoint UploadMedia goa.Endpoint DeleteMedia goa.Endpoint }
Endpoints wraps the "notes" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "notes" service with endpoints.
type ExistingFieldNote ¶
type FieldNoteAuthor ¶
type FieldNoteStation ¶
type FieldNoteStation struct {
ReadOnly bool
}
type FieldNoteUpdate ¶
type FieldNoteUpdate struct { Notes []*ExistingFieldNote Creating []*NewFieldNote }
type FieldNotes ¶
type FieldNotes struct { Notes []*FieldNote Media []*NoteMedia Station *FieldNoteStation }
FieldNotes is the result type of the notes service update method.
func NewFieldNotes ¶
func NewFieldNotes(vres *notesviews.FieldNotes) *FieldNotes
NewFieldNotes initializes result type FieldNotes from viewed result type FieldNotes.
type GetPayload ¶
GetPayload is the payload type of the notes service get method.
type NewFieldNote ¶
type NoteMedia ¶
NoteMedia is the result type of the notes service upload media method.
func NewNoteMedia ¶
func NewNoteMedia(vres *notesviews.NoteMedia) *NoteMedia
NewNoteMedia initializes result type NoteMedia from viewed result type NoteMedia.
type Service ¶
type Service interface { // Update implements update. Update(context.Context, *UpdatePayload) (res *FieldNotes, err error) // Get implements get. Get(context.Context, *GetPayload) (res *FieldNotes, err error) // DownloadMedia implements download media. DownloadMedia(context.Context, *DownloadMediaPayload) (res *DownloadMediaResult, body io.ReadCloser, err error) // UploadMedia implements upload media. UploadMedia(context.Context, *UploadMediaPayload, io.ReadCloser) (res *NoteMedia, err error) // DeleteMedia implements delete media. DeleteMedia(context.Context, *DeleteMediaPayload) (err error) }
Service is the notes service interface.
type UpdatePayload ¶
type UpdatePayload struct { Auth string StationID int32 Notes *FieldNoteUpdate }
UpdatePayload is the payload type of the notes service update method.
type UploadMediaPayload ¶
type UploadMediaPayload struct { Auth string ContentLength int64 ContentType string StationID int32 Key string }
UploadMediaPayload is the payload type of the notes service upload media method.
type UploadMediaRequestData ¶
type UploadMediaRequestData struct { // Payload is the method payload. Payload *UploadMediaPayload // Body streams the HTTP request body. Body io.ReadCloser }
UploadMediaRequestData holds both the payload and the HTTP request body reader of the "upload media" method.