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 NewDataEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewDeleteMessageEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewPostMessageEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewProjectEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewUpdateMessageEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
- func NewViewedDiscussion(res *Discussion, view string) *discussionviews.Discussion
- type Auther
- type AuthorPhoto
- type Client
- func (c *Client) Data(ctx context.Context, p *DataPayload) (res *Discussion, err error)
- func (c *Client) DeleteMessage(ctx context.Context, p *DeleteMessagePayload) (err error)
- func (c *Client) PostMessage(ctx context.Context, p *PostMessagePayload) (res *PostMessageResult, err error)
- func (c *Client) Project(ctx context.Context, p *ProjectPayload) (res *Discussion, err error)
- func (c *Client) UpdateMessage(ctx context.Context, p *UpdateMessagePayload) (res *UpdateMessageResult, err error)
- type DataPayload
- type DeleteMessagePayload
- type Discussion
- type Endpoints
- type NewPost
- type PostAuthor
- type PostMessagePayload
- type PostMessageResult
- type ProjectPayload
- type Service
- type ThreadedPost
- type UpdateMessagePayload
- type UpdateMessageResult
Constants ¶
const ServiceName = "discussion"
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{"project", "data", "post message", "update message", "delete message"}
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 NewDataEndpoint ¶
func NewDataEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewDataEndpoint returns an endpoint function that calls the method "data" of service "discussion".
func NewDeleteMessageEndpoint ¶
func NewDeleteMessageEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewDeleteMessageEndpoint returns an endpoint function that calls the method "delete message" of service "discussion".
func NewPostMessageEndpoint ¶
func NewPostMessageEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewPostMessageEndpoint returns an endpoint function that calls the method "post message" of service "discussion".
func NewProjectEndpoint ¶
func NewProjectEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewProjectEndpoint returns an endpoint function that calls the method "project" of service "discussion".
func NewUpdateMessageEndpoint ¶
func NewUpdateMessageEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint
NewUpdateMessageEndpoint returns an endpoint function that calls the method "update message" of service "discussion".
func NewViewedDiscussion ¶
func NewViewedDiscussion(res *Discussion, view string) *discussionviews.Discussion
NewViewedDiscussion initializes viewed result type Discussion from result type Discussion 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 AuthorPhoto ¶
type AuthorPhoto struct {
URL string
}
type Client ¶
type Client struct { ProjectEndpoint goa.Endpoint DataEndpoint goa.Endpoint PostMessageEndpoint goa.Endpoint UpdateMessageEndpoint goa.Endpoint DeleteMessageEndpoint goa.Endpoint }
Client is the "discussion" service client.
func (*Client) Data ¶
func (c *Client) Data(ctx context.Context, p *DataPayload) (res *Discussion, err error)
Data calls the "data" endpoint of the "discussion" service.
func (*Client) DeleteMessage ¶
func (c *Client) DeleteMessage(ctx context.Context, p *DeleteMessagePayload) (err error)
DeleteMessage calls the "delete message" endpoint of the "discussion" service.
func (*Client) PostMessage ¶
func (c *Client) PostMessage(ctx context.Context, p *PostMessagePayload) (res *PostMessageResult, err error)
PostMessage calls the "post message" endpoint of the "discussion" service.
func (*Client) Project ¶
func (c *Client) Project(ctx context.Context, p *ProjectPayload) (res *Discussion, err error)
Project calls the "project" endpoint of the "discussion" service.
func (*Client) UpdateMessage ¶
func (c *Client) UpdateMessage(ctx context.Context, p *UpdateMessagePayload) (res *UpdateMessageResult, err error)
UpdateMessage calls the "update message" endpoint of the "discussion" service.
type DataPayload ¶
DataPayload is the payload type of the discussion service data method.
type DeleteMessagePayload ¶
DeleteMessagePayload is the payload type of the discussion service delete message method.
type Discussion ¶
type Discussion struct {
Posts []*ThreadedPost
}
Discussion is the result type of the discussion service project method.
func NewDiscussion ¶
func NewDiscussion(vres *discussionviews.Discussion) *Discussion
NewDiscussion initializes result type Discussion from viewed result type Discussion.
type Endpoints ¶
type Endpoints struct { Project goa.Endpoint Data goa.Endpoint PostMessage goa.Endpoint UpdateMessage goa.Endpoint DeleteMessage goa.Endpoint }
Endpoints wraps the "discussion" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "discussion" service with endpoints.
type PostAuthor ¶
type PostAuthor struct { ID int32 Name string Photo *AuthorPhoto }
type PostMessagePayload ¶
PostMessagePayload is the payload type of the discussion service post message method.
type PostMessageResult ¶
type PostMessageResult struct {
Post *ThreadedPost
}
PostMessageResult is the result type of the discussion service post message method.
type ProjectPayload ¶
ProjectPayload is the payload type of the discussion service project method.
type Service ¶
type Service interface { // Project implements project. Project(context.Context, *ProjectPayload) (res *Discussion, err error) // Data implements data. Data(context.Context, *DataPayload) (res *Discussion, err error) // PostMessage implements post message. PostMessage(context.Context, *PostMessagePayload) (res *PostMessageResult, err error) // UpdateMessage implements update message. UpdateMessage(context.Context, *UpdateMessagePayload) (res *UpdateMessageResult, err error) // DeleteMessage implements delete message. DeleteMessage(context.Context, *DeleteMessagePayload) (err error) }
Service is the discussion service interface.
type ThreadedPost ¶
type ThreadedPost struct { ID int64 CreatedAt int64 UpdatedAt int64 Author *PostAuthor Replies []*ThreadedPost Body string Bookmark *string }
type UpdateMessagePayload ¶
UpdateMessagePayload is the payload type of the discussion service update message method.
type UpdateMessageResult ¶
type UpdateMessageResult struct {
Post *ThreadedPost
}
UpdateMessageResult is the result type of the discussion service update message method.