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 NewAddNoteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewDeleteNoteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewStationEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewUpdateNoteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewViewedStationNote(res *StationNote, view string) *stationnoteviews.StationNote
- func NewViewedStationNotes(res *StationNotes, view string) *stationnoteviews.StationNotes
- type AddNotePayload
- type Auther
- type Client
- func (c *Client) AddNote(ctx context.Context, p *AddNotePayload) (res *StationNote, err error)
- func (c *Client) DeleteNote(ctx context.Context, p *DeleteNotePayload) (err error)
- func (c *Client) Station(ctx context.Context, p *StationPayload) (res *StationNotes, err error)
- func (c *Client) UpdateNote(ctx context.Context, p *UpdateNotePayload) (res *StationNote, err error)
- type DeleteNotePayload
- type Endpoints
- type Service
- type StationNote
- type StationNoteAuthor
- type StationNoteAuthorPhoto
- type StationNotes
- type StationPayload
- type UpdateNotePayload
Constants ¶
const ServiceName = "station_note"
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 = [4]string{"station", "add note", "update note", "delete note"}
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 NewAddNoteEndpoint ¶
func NewAddNoteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewAddNoteEndpoint returns an endpoint function that calls the method "add note" of service "station_note".
func NewDeleteNoteEndpoint ¶
func NewDeleteNoteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewDeleteNoteEndpoint returns an endpoint function that calls the method "delete note" of service "station_note".
func NewStationEndpoint ¶
func NewStationEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewStationEndpoint returns an endpoint function that calls the method "station" of service "station_note".
func NewUpdateNoteEndpoint ¶
func NewUpdateNoteEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewUpdateNoteEndpoint returns an endpoint function that calls the method "update note" of service "station_note".
func NewViewedStationNote ¶
func NewViewedStationNote(res *StationNote, view string) *stationnoteviews.StationNote
NewViewedStationNote initializes viewed result type StationNote from result type StationNote using the given view.
func NewViewedStationNotes ¶
func NewViewedStationNotes(res *StationNotes, view string) *stationnoteviews.StationNotes
NewViewedStationNotes initializes viewed result type StationNotes from result type StationNotes using the given view.
Types ¶
type AddNotePayload ¶
AddNotePayload is the payload type of the station_note service add note method.
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 { StationEndpoint goa.Endpoint AddNoteEndpoint goa.Endpoint UpdateNoteEndpoint goa.Endpoint DeleteNoteEndpoint goa.Endpoint }
Client is the "station_note" service client.
func (*Client) AddNote ¶
func (c *Client) AddNote(ctx context.Context, p *AddNotePayload) (res *StationNote, err error)
AddNote calls the "add note" endpoint of the "station_note" service.
func (*Client) DeleteNote ¶
func (c *Client) DeleteNote(ctx context.Context, p *DeleteNotePayload) (err error)
DeleteNote calls the "delete note" endpoint of the "station_note" service.
func (*Client) Station ¶
func (c *Client) Station(ctx context.Context, p *StationPayload) (res *StationNotes, err error)
Station calls the "station" endpoint of the "station_note" service.
func (*Client) UpdateNote ¶
func (c *Client) UpdateNote(ctx context.Context, p *UpdateNotePayload) (res *StationNote, err error)
UpdateNote calls the "update note" endpoint of the "station_note" service.
type DeleteNotePayload ¶
DeleteNotePayload is the payload type of the station_note service delete note method.
type Endpoints ¶
type Endpoints struct { Station goa.Endpoint AddNote goa.Endpoint UpdateNote goa.Endpoint DeleteNote goa.Endpoint }
Endpoints wraps the "station_note" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "station_note" service with endpoints.
type Service ¶
type Service interface { // Station implements station. Station(context.Context, *StationPayload) (res *StationNotes, err error) // AddNote implements add note. AddNote(context.Context, *AddNotePayload) (res *StationNote, err error) // UpdateNote implements update note. UpdateNote(context.Context, *UpdateNotePayload) (res *StationNote, err error) // DeleteNote implements delete note. DeleteNote(context.Context, *DeleteNotePayload) (err error) }
Service is the station_note service interface.
type StationNote ¶
type StationNote struct { ID int32 CreatedAt int64 UpdatedAt int64 Author *StationNoteAuthor Body string }
StationNote is the result type of the station_note service add note method.
func NewStationNote ¶
func NewStationNote(vres *stationnoteviews.StationNote) *StationNote
NewStationNote initializes result type StationNote from viewed result type StationNote.
type StationNoteAuthor ¶
type StationNoteAuthor struct { ID int32 Name string Photo *StationNoteAuthorPhoto }
type StationNoteAuthorPhoto ¶
type StationNoteAuthorPhoto struct {
URL string
}
type StationNotes ¶
type StationNotes struct {
Notes []*StationNote
}
StationNotes is the result type of the station_note service station method.
func NewStationNotes ¶
func NewStationNotes(vres *stationnoteviews.StationNotes) *StationNotes
NewStationNotes initializes result type StationNotes from viewed result type StationNotes.
type StationPayload ¶
StationPayload is the payload type of the station_note service station method.