server

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DataDiscussionPath

func DataDiscussionPath() string

DataDiscussionPath returns the URL path to the discussion service data HTTP endpoint.

func DecodeDataRequest

func DecodeDataRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeDataRequest returns a decoder for requests sent to the discussion data endpoint.

func DecodeDeleteMessageRequest

func DecodeDeleteMessageRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeDeleteMessageRequest returns a decoder for requests sent to the discussion delete message endpoint.

func DecodePostMessageRequest

func DecodePostMessageRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodePostMessageRequest returns a decoder for requests sent to the discussion post message endpoint.

func DecodeProjectRequest

func DecodeProjectRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeProjectRequest returns a decoder for requests sent to the discussion project endpoint.

func DecodeUpdateMessageRequest

func DecodeUpdateMessageRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (interface{}, error)

DecodeUpdateMessageRequest returns a decoder for requests sent to the discussion update message endpoint.

func DeleteMessageDiscussionPath

func DeleteMessageDiscussionPath(postID int64) string

DeleteMessageDiscussionPath returns the URL path to the discussion service delete message HTTP endpoint.

func EncodeDataError

func EncodeDataError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeDataError returns an encoder for errors returned by the data discussion endpoint.

func EncodeDataResponse

func EncodeDataResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeDataResponse returns an encoder for responses returned by the discussion data endpoint.

func EncodeDeleteMessageError

func EncodeDeleteMessageError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeDeleteMessageError returns an encoder for errors returned by the delete message discussion endpoint.

func EncodeDeleteMessageResponse

func EncodeDeleteMessageResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeDeleteMessageResponse returns an encoder for responses returned by the discussion delete message endpoint.

func EncodePostMessageError

func EncodePostMessageError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodePostMessageError returns an encoder for errors returned by the post message discussion endpoint.

func EncodePostMessageResponse

func EncodePostMessageResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodePostMessageResponse returns an encoder for responses returned by the discussion post message endpoint.

func EncodeProjectError

func EncodeProjectError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeProjectError returns an encoder for errors returned by the project discussion endpoint.

func EncodeProjectResponse

func EncodeProjectResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeProjectResponse returns an encoder for responses returned by the discussion project endpoint.

func EncodeUpdateMessageError

func EncodeUpdateMessageError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeUpdateMessageError returns an encoder for errors returned by the update message discussion endpoint.

func EncodeUpdateMessageResponse

func EncodeUpdateMessageResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, interface{}) error

EncodeUpdateMessageResponse returns an encoder for responses returned by the discussion update message endpoint.

func Mount

func Mount(mux goahttp.Muxer, h *Server)

Mount configures the mux to serve the discussion endpoints.

func MountCORSHandler

func MountCORSHandler(mux goahttp.Muxer, h http.Handler)

MountCORSHandler configures the mux to serve the CORS endpoints for the service discussion.

func MountDataHandler

func MountDataHandler(mux goahttp.Muxer, h http.Handler)

MountDataHandler configures the mux to serve the "discussion" service "data" endpoint.

func MountDeleteMessageHandler

func MountDeleteMessageHandler(mux goahttp.Muxer, h http.Handler)

MountDeleteMessageHandler configures the mux to serve the "discussion" service "delete message" endpoint.

func MountPostMessageHandler

func MountPostMessageHandler(mux goahttp.Muxer, h http.Handler)

MountPostMessageHandler configures the mux to serve the "discussion" service "post message" endpoint.

func MountProjectHandler

func MountProjectHandler(mux goahttp.Muxer, h http.Handler)

MountProjectHandler configures the mux to serve the "discussion" service "project" endpoint.

func MountUpdateMessageHandler

func MountUpdateMessageHandler(mux goahttp.Muxer, h http.Handler)

MountUpdateMessageHandler configures the mux to serve the "discussion" service "update message" endpoint.

func NewCORSHandler

func NewCORSHandler() http.Handler

NewCORSHandler creates a HTTP handler which returns a simple 200 response.

func NewDataHandler

func NewDataHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewDataHandler creates a HTTP handler which loads the HTTP request and calls the "discussion" service "data" endpoint.

func NewDataPayload

func NewDataPayload(bookmark string, auth *string) *discussion.DataPayload

NewDataPayload builds a discussion service data endpoint payload.

func NewDeleteMessageHandler

func NewDeleteMessageHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewDeleteMessageHandler creates a HTTP handler which loads the HTTP request and calls the "discussion" service "delete message" endpoint.

func NewDeleteMessagePayload

func NewDeleteMessagePayload(postID int64, auth string) *discussion.DeleteMessagePayload

NewDeleteMessagePayload builds a discussion service delete message endpoint payload.

func NewPostMessageHandler

func NewPostMessageHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewPostMessageHandler creates a HTTP handler which loads the HTTP request and calls the "discussion" service "post message" endpoint.

func NewPostMessagePayload

func NewPostMessagePayload(body *PostMessageRequestBody, auth string) *discussion.PostMessagePayload

NewPostMessagePayload builds a discussion service post message endpoint payload.

func NewProjectHandler

func NewProjectHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewProjectHandler creates a HTTP handler which loads the HTTP request and calls the "discussion" service "project" endpoint.

func NewProjectPayload

func NewProjectPayload(projectID int32, auth *string) *discussion.ProjectPayload

NewProjectPayload builds a discussion service project endpoint payload.

func NewUpdateMessageHandler

func NewUpdateMessageHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) http.Handler

NewUpdateMessageHandler creates a HTTP handler which loads the HTTP request and calls the "discussion" service "update message" endpoint.

func NewUpdateMessagePayload

func NewUpdateMessagePayload(body *UpdateMessageRequestBody, postID int64, auth string) *discussion.UpdateMessagePayload

NewUpdateMessagePayload builds a discussion service update message endpoint payload.

func PostMessageDiscussionPath

func PostMessageDiscussionPath() string

PostMessageDiscussionPath returns the URL path to the discussion service post message HTTP endpoint.

func ProjectDiscussionPath

func ProjectDiscussionPath(projectID int32) string

ProjectDiscussionPath returns the URL path to the discussion service project HTTP endpoint.

func UpdateMessageDiscussionPath

func UpdateMessageDiscussionPath(postID int64) string

UpdateMessageDiscussionPath returns the URL path to the discussion service update message HTTP endpoint.

func ValidateNewPostRequestBody

func ValidateNewPostRequestBody(body *NewPostRequestBody) (err error)

ValidateNewPostRequestBody runs the validations defined on NewPostRequestBody

func ValidatePostMessageRequestBody

func ValidatePostMessageRequestBody(body *PostMessageRequestBody) (err error)

ValidatePostMessageRequestBody runs the validations defined on Post MessageRequestBody

func ValidateUpdateMessageRequestBody

func ValidateUpdateMessageRequestBody(body *UpdateMessageRequestBody) (err error)

ValidateUpdateMessageRequestBody runs the validations defined on Update MessageRequestBody

Types

type AuthorPhotoResponseBody

type AuthorPhotoResponseBody struct {
	URL string `form:"url" json:"url" xml:"url"`
}

AuthorPhotoResponseBody is used to define fields on response body types.

type DataBadRequestResponseBody

type DataBadRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

DataBadRequestResponseBody is the type of the "discussion" service "data" endpoint HTTP response body for the "bad-request" error.

func NewDataBadRequestResponseBody

func NewDataBadRequestResponseBody(res *goa.ServiceError) *DataBadRequestResponseBody

NewDataBadRequestResponseBody builds the HTTP response body from the result of the "data" endpoint of the "discussion" service.

type DataForbiddenResponseBody

type DataForbiddenResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

DataForbiddenResponseBody is the type of the "discussion" service "data" endpoint HTTP response body for the "forbidden" error.

func NewDataForbiddenResponseBody

func NewDataForbiddenResponseBody(res *goa.ServiceError) *DataForbiddenResponseBody

NewDataForbiddenResponseBody builds the HTTP response body from the result of the "data" endpoint of the "discussion" service.

type DataNotFoundResponseBody

type DataNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

DataNotFoundResponseBody is the type of the "discussion" service "data" endpoint HTTP response body for the "not-found" error.

func NewDataNotFoundResponseBody

func NewDataNotFoundResponseBody(res *goa.ServiceError) *DataNotFoundResponseBody

NewDataNotFoundResponseBody builds the HTTP response body from the result of the "data" endpoint of the "discussion" service.

type DataResponseBody

type DataResponseBody struct {
	Posts []*ThreadedPostResponseBody `form:"posts" json:"posts" xml:"posts"`
}

DataResponseBody is the type of the "discussion" service "data" endpoint HTTP response body.

func NewDataResponseBody

func NewDataResponseBody(res *discussionviews.DiscussionView) *DataResponseBody

NewDataResponseBody builds the HTTP response body from the result of the "data" endpoint of the "discussion" service.

type DataUnauthorizedResponseBody

type DataUnauthorizedResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

DataUnauthorizedResponseBody is the type of the "discussion" service "data" endpoint HTTP response body for the "unauthorized" error.

func NewDataUnauthorizedResponseBody

func NewDataUnauthorizedResponseBody(res *goa.ServiceError) *DataUnauthorizedResponseBody

NewDataUnauthorizedResponseBody builds the HTTP response body from the result of the "data" endpoint of the "discussion" service.

type DeleteMessageBadRequestResponseBody

type DeleteMessageBadRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

DeleteMessageBadRequestResponseBody is the type of the "discussion" service "delete message" endpoint HTTP response body for the "bad-request" error.

func NewDeleteMessageBadRequestResponseBody

func NewDeleteMessageBadRequestResponseBody(res *goa.ServiceError) *DeleteMessageBadRequestResponseBody

NewDeleteMessageBadRequestResponseBody builds the HTTP response body from the result of the "delete message" endpoint of the "discussion" service.

type DeleteMessageForbiddenResponseBody

type DeleteMessageForbiddenResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

DeleteMessageForbiddenResponseBody is the type of the "discussion" service "delete message" endpoint HTTP response body for the "forbidden" error.

func NewDeleteMessageForbiddenResponseBody

func NewDeleteMessageForbiddenResponseBody(res *goa.ServiceError) *DeleteMessageForbiddenResponseBody

NewDeleteMessageForbiddenResponseBody builds the HTTP response body from the result of the "delete message" endpoint of the "discussion" service.

type DeleteMessageNotFoundResponseBody

type DeleteMessageNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

DeleteMessageNotFoundResponseBody is the type of the "discussion" service "delete message" endpoint HTTP response body for the "not-found" error.

func NewDeleteMessageNotFoundResponseBody

func NewDeleteMessageNotFoundResponseBody(res *goa.ServiceError) *DeleteMessageNotFoundResponseBody

NewDeleteMessageNotFoundResponseBody builds the HTTP response body from the result of the "delete message" endpoint of the "discussion" service.

type DeleteMessageUnauthorizedResponseBody

type DeleteMessageUnauthorizedResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

DeleteMessageUnauthorizedResponseBody is the type of the "discussion" service "delete message" endpoint HTTP response body for the "unauthorized" error.

func NewDeleteMessageUnauthorizedResponseBody

func NewDeleteMessageUnauthorizedResponseBody(res *goa.ServiceError) *DeleteMessageUnauthorizedResponseBody

NewDeleteMessageUnauthorizedResponseBody builds the HTTP response body from the result of the "delete message" endpoint of the "discussion" service.

type ErrorNamer

type ErrorNamer interface {
	ErrorName() string
}

ErrorNamer is an interface implemented by generated error structs that exposes the name of the error as defined in the design.

type MountPoint

type MountPoint struct {
	// Method is the name of the service method served by the mounted HTTP handler.
	Method string
	// Verb is the HTTP method used to match requests to the mounted handler.
	Verb string
	// Pattern is the HTTP request path pattern used to match requests to the
	// mounted handler.
	Pattern string
}

MountPoint holds information about the mounted endpoints.

type NewPostRequestBody

type NewPostRequestBody struct {
	ThreadID  *int64  `form:"threadId,omitempty" json:"threadId,omitempty" xml:"threadId,omitempty"`
	Body      *string `form:"body,omitempty" json:"body,omitempty" xml:"body,omitempty"`
	ProjectID *int32  `form:"projectId,omitempty" json:"projectId,omitempty" xml:"projectId,omitempty"`
	Bookmark  *string `form:"bookmark,omitempty" json:"bookmark,omitempty" xml:"bookmark,omitempty"`
}

NewPostRequestBody is used to define fields on request body types.

type PostAuthorResponseBody

type PostAuthorResponseBody struct {
	ID    int32                    `form:"id" json:"id" xml:"id"`
	Name  string                   `form:"name" json:"name" xml:"name"`
	Photo *AuthorPhotoResponseBody `form:"photo,omitempty" json:"photo,omitempty" xml:"photo,omitempty"`
}

PostAuthorResponseBody is used to define fields on response body types.

type PostMessageBadRequestResponseBody

type PostMessageBadRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

PostMessageBadRequestResponseBody is the type of the "discussion" service "post message" endpoint HTTP response body for the "bad-request" error.

func NewPostMessageBadRequestResponseBody

func NewPostMessageBadRequestResponseBody(res *goa.ServiceError) *PostMessageBadRequestResponseBody

NewPostMessageBadRequestResponseBody builds the HTTP response body from the result of the "post message" endpoint of the "discussion" service.

type PostMessageForbiddenResponseBody

type PostMessageForbiddenResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

PostMessageForbiddenResponseBody is the type of the "discussion" service "post message" endpoint HTTP response body for the "forbidden" error.

func NewPostMessageForbiddenResponseBody

func NewPostMessageForbiddenResponseBody(res *goa.ServiceError) *PostMessageForbiddenResponseBody

NewPostMessageForbiddenResponseBody builds the HTTP response body from the result of the "post message" endpoint of the "discussion" service.

type PostMessageNotFoundResponseBody

type PostMessageNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

PostMessageNotFoundResponseBody is the type of the "discussion" service "post message" endpoint HTTP response body for the "not-found" error.

func NewPostMessageNotFoundResponseBody

func NewPostMessageNotFoundResponseBody(res *goa.ServiceError) *PostMessageNotFoundResponseBody

NewPostMessageNotFoundResponseBody builds the HTTP response body from the result of the "post message" endpoint of the "discussion" service.

type PostMessageRequestBody

type PostMessageRequestBody struct {
	Post *NewPostRequestBody `form:"post,omitempty" json:"post,omitempty" xml:"post,omitempty"`
}

PostMessageRequestBody is the type of the "discussion" service "post message" endpoint HTTP request body.

type PostMessageResponseBody

type PostMessageResponseBody struct {
	Post *ThreadedPostResponseBody `form:"post" json:"post" xml:"post"`
}

PostMessageResponseBody is the type of the "discussion" service "post message" endpoint HTTP response body.

func NewPostMessageResponseBody

func NewPostMessageResponseBody(res *discussion.PostMessageResult) *PostMessageResponseBody

NewPostMessageResponseBody builds the HTTP response body from the result of the "post message" endpoint of the "discussion" service.

type PostMessageUnauthorizedResponseBody

type PostMessageUnauthorizedResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

PostMessageUnauthorizedResponseBody is the type of the "discussion" service "post message" endpoint HTTP response body for the "unauthorized" error.

func NewPostMessageUnauthorizedResponseBody

func NewPostMessageUnauthorizedResponseBody(res *goa.ServiceError) *PostMessageUnauthorizedResponseBody

NewPostMessageUnauthorizedResponseBody builds the HTTP response body from the result of the "post message" endpoint of the "discussion" service.

type ProjectBadRequestResponseBody

type ProjectBadRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

ProjectBadRequestResponseBody is the type of the "discussion" service "project" endpoint HTTP response body for the "bad-request" error.

func NewProjectBadRequestResponseBody

func NewProjectBadRequestResponseBody(res *goa.ServiceError) *ProjectBadRequestResponseBody

NewProjectBadRequestResponseBody builds the HTTP response body from the result of the "project" endpoint of the "discussion" service.

type ProjectForbiddenResponseBody

type ProjectForbiddenResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

ProjectForbiddenResponseBody is the type of the "discussion" service "project" endpoint HTTP response body for the "forbidden" error.

func NewProjectForbiddenResponseBody

func NewProjectForbiddenResponseBody(res *goa.ServiceError) *ProjectForbiddenResponseBody

NewProjectForbiddenResponseBody builds the HTTP response body from the result of the "project" endpoint of the "discussion" service.

type ProjectNotFoundResponseBody

type ProjectNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

ProjectNotFoundResponseBody is the type of the "discussion" service "project" endpoint HTTP response body for the "not-found" error.

func NewProjectNotFoundResponseBody

func NewProjectNotFoundResponseBody(res *goa.ServiceError) *ProjectNotFoundResponseBody

NewProjectNotFoundResponseBody builds the HTTP response body from the result of the "project" endpoint of the "discussion" service.

type ProjectResponseBody

type ProjectResponseBody struct {
	Posts []*ThreadedPostResponseBody `form:"posts" json:"posts" xml:"posts"`
}

ProjectResponseBody is the type of the "discussion" service "project" endpoint HTTP response body.

func NewProjectResponseBody

func NewProjectResponseBody(res *discussionviews.DiscussionView) *ProjectResponseBody

NewProjectResponseBody builds the HTTP response body from the result of the "project" endpoint of the "discussion" service.

type ProjectUnauthorizedResponseBody

type ProjectUnauthorizedResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

ProjectUnauthorizedResponseBody is the type of the "discussion" service "project" endpoint HTTP response body for the "unauthorized" error.

func NewProjectUnauthorizedResponseBody

func NewProjectUnauthorizedResponseBody(res *goa.ServiceError) *ProjectUnauthorizedResponseBody

NewProjectUnauthorizedResponseBody builds the HTTP response body from the result of the "project" endpoint of the "discussion" service.

type Server

type Server struct {
	Mounts        []*MountPoint
	Project       http.Handler
	Data          http.Handler
	PostMessage   http.Handler
	UpdateMessage http.Handler
	DeleteMessage http.Handler
	CORS          http.Handler
}

Server lists the discussion service endpoint HTTP handlers.

func New

func New(
	e *discussion.Endpoints,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(err error) goahttp.Statuser,
) *Server

New instantiates HTTP handlers for all the discussion service endpoints using the provided encoder and decoder. The handlers are mounted on the given mux using the HTTP verb and path defined in the design. errhandler is called whenever a response fails to be encoded. formatter is used to format errors returned by the service methods prior to encoding. Both errhandler and formatter are optional and can be nil.

func (*Server) Service

func (s *Server) Service() string

Service returns the name of the service served.

func (*Server) Use

func (s *Server) Use(m func(http.Handler) http.Handler)

Use wraps the server handlers with the given middleware.

type ThreadedPostResponseBody

type ThreadedPostResponseBody struct {
	ID        int64                       `form:"id" json:"id" xml:"id"`
	CreatedAt int64                       `form:"createdAt" json:"createdAt" xml:"createdAt"`
	UpdatedAt int64                       `form:"updatedAt" json:"updatedAt" xml:"updatedAt"`
	Author    *PostAuthorResponseBody     `form:"author" json:"author" xml:"author"`
	Replies   []*ThreadedPostResponseBody `form:"replies" json:"replies" xml:"replies"`
	Body      string                      `form:"body" json:"body" xml:"body"`
	Bookmark  *string                     `form:"bookmark,omitempty" json:"bookmark,omitempty" xml:"bookmark,omitempty"`
}

ThreadedPostResponseBody is used to define fields on response body types.

type UpdateMessageBadRequestResponseBody

type UpdateMessageBadRequestResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

UpdateMessageBadRequestResponseBody is the type of the "discussion" service "update message" endpoint HTTP response body for the "bad-request" error.

func NewUpdateMessageBadRequestResponseBody

func NewUpdateMessageBadRequestResponseBody(res *goa.ServiceError) *UpdateMessageBadRequestResponseBody

NewUpdateMessageBadRequestResponseBody builds the HTTP response body from the result of the "update message" endpoint of the "discussion" service.

type UpdateMessageForbiddenResponseBody

type UpdateMessageForbiddenResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

UpdateMessageForbiddenResponseBody is the type of the "discussion" service "update message" endpoint HTTP response body for the "forbidden" error.

func NewUpdateMessageForbiddenResponseBody

func NewUpdateMessageForbiddenResponseBody(res *goa.ServiceError) *UpdateMessageForbiddenResponseBody

NewUpdateMessageForbiddenResponseBody builds the HTTP response body from the result of the "update message" endpoint of the "discussion" service.

type UpdateMessageNotFoundResponseBody

type UpdateMessageNotFoundResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

UpdateMessageNotFoundResponseBody is the type of the "discussion" service "update message" endpoint HTTP response body for the "not-found" error.

func NewUpdateMessageNotFoundResponseBody

func NewUpdateMessageNotFoundResponseBody(res *goa.ServiceError) *UpdateMessageNotFoundResponseBody

NewUpdateMessageNotFoundResponseBody builds the HTTP response body from the result of the "update message" endpoint of the "discussion" service.

type UpdateMessageRequestBody

type UpdateMessageRequestBody struct {
	Body *string `form:"body,omitempty" json:"body,omitempty" xml:"body,omitempty"`
}

UpdateMessageRequestBody is the type of the "discussion" service "update message" endpoint HTTP request body.

type UpdateMessageResponseBody

type UpdateMessageResponseBody struct {
	Post *ThreadedPostResponseBody `form:"post" json:"post" xml:"post"`
}

UpdateMessageResponseBody is the type of the "discussion" service "update message" endpoint HTTP response body.

func NewUpdateMessageResponseBody

func NewUpdateMessageResponseBody(res *discussion.UpdateMessageResult) *UpdateMessageResponseBody

NewUpdateMessageResponseBody builds the HTTP response body from the result of the "update message" endpoint of the "discussion" service.

type UpdateMessageUnauthorizedResponseBody

type UpdateMessageUnauthorizedResponseBody struct {
	// Name is the name of this class of errors.
	Name string `form:"name" json:"name" xml:"name"`
	// ID is a unique identifier for this particular occurrence of the problem.
	ID string `form:"id" json:"id" xml:"id"`
	// Message is a human-readable explanation specific to this occurrence of the
	// problem.
	Message string `form:"message" json:"message" xml:"message"`
	// Is the error temporary?
	Temporary bool `form:"temporary" json:"temporary" xml:"temporary"`
	// Is the error a timeout?
	Timeout bool `form:"timeout" json:"timeout" xml:"timeout"`
	// Is the error a server-side fault?
	Fault bool `form:"fault" json:"fault" xml:"fault"`
}

UpdateMessageUnauthorizedResponseBody is the type of the "discussion" service "update message" endpoint HTTP response body for the "unauthorized" error.

func NewUpdateMessageUnauthorizedResponseBody

func NewUpdateMessageUnauthorizedResponseBody(res *goa.ServiceError) *UpdateMessageUnauthorizedResponseBody

NewUpdateMessageUnauthorizedResponseBody builds the HTTP response body from the result of the "update message" endpoint of the "discussion" service.

Jump to

Keyboard shortcuts

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