server

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2023 License: Apache-2.0, BSD-3-Clause, MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateTaskListPath

func CreateTaskListPath(taskListName string) string

CreateTaskListPath returns the URL path to the taskList service Create HTTP endpoint.

func DecodeCreateRequest

func DecodeCreateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)

DecodeCreateRequest returns a decoder for requests sent to the taskList Create endpoint.

func DecodeTaskListStatusRequest

func DecodeTaskListStatusRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (any, error)

DecodeTaskListStatusRequest returns a decoder for requests sent to the taskList TaskListStatus endpoint.

func EncodeCreateResponse

func EncodeCreateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeCreateResponse returns an encoder for responses returned by the taskList Create endpoint.

func EncodeTaskListStatusResponse

func EncodeTaskListStatusResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeTaskListStatusResponse returns an encoder for responses returned by the taskList TaskListStatus endpoint.

func Mount

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

Mount configures the mux to serve the taskList endpoints.

func MountCreateHandler

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

MountCreateHandler configures the mux to serve the "taskList" service "Create" endpoint.

func MountTaskListStatusHandler

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

MountTaskListStatusHandler configures the mux to serve the "taskList" service "TaskListStatus" endpoint.

func NewCreateHandler

func NewCreateHandler(
	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(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewCreateHandler creates a HTTP handler which loads the HTTP request and calls the "taskList" service "Create" endpoint.

func NewCreateTaskListRequest

func NewCreateTaskListRequest(body any, taskListName string, cacheNamespace *string, cacheScope *string) *tasklist.CreateTaskListRequest

NewCreateTaskListRequest builds a taskList service Create endpoint payload.

func NewTaskListStatusHandler

func NewTaskListStatusHandler(
	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(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewTaskListStatusHandler creates a HTTP handler which loads the HTTP request and calls the "taskList" service "TaskListStatus" endpoint.

func NewTaskListStatusRequest

func NewTaskListStatusRequest(taskListID string) *tasklist.TaskListStatusRequest

NewTaskListStatusRequest builds a taskList service TaskListStatus endpoint payload.

func TaskListStatusTaskListPath

func TaskListStatusTaskListPath(taskListID string) string

TaskListStatusTaskListPath returns the URL path to the taskList service TaskListStatus HTTP endpoint.

Types

type CreateResponseBody

type CreateResponseBody struct {
	// Unique taskList identifier.
	TaskListID string `form:"taskListID" json:"taskListID" xml:"taskListID"`
}

CreateResponseBody is the type of the "taskList" service "Create" endpoint HTTP response body.

func NewCreateResponseBody

func NewCreateResponseBody(res *tasklist.CreateTaskListResult) *CreateResponseBody

NewCreateResponseBody builds the HTTP response body from the result of the "Create" endpoint of the "taskList" service.

type GroupStatusResponseBody

type GroupStatusResponseBody struct {
	// Unique group identifier.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Current status of the group
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Array of TaskStatus
	Tasks []*TaskStatusResponseBody `form:"tasks,omitempty" json:"tasks,omitempty" xml:"tasks,omitempty"`
}

GroupStatusResponseBody is used to define fields on response body types.

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 Server

type Server struct {
	Mounts         []*MountPoint
	Create         http.Handler
	TaskListStatus http.Handler
}

Server lists the taskList service endpoint HTTP handlers.

func New

func New(
	e *tasklist.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(ctx context.Context, err error) goahttp.Statuser,
) *Server

New instantiates HTTP handlers for all the taskList 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) MethodNames

func (s *Server) MethodNames() []string

MethodNames returns the methods served.

func (*Server) Mount

func (s *Server) Mount(mux goahttp.Muxer)

Mount configures the mux to serve the taskList endpoints.

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 TaskListStatusAcceptedResponseBody

type TaskListStatusAcceptedResponseBody struct {
	// Unique taskList identifier.
	ID string `form:"id" json:"id" xml:"id"`
	// Current status of the taskList
	Status string `form:"status" json:"status" xml:"status"`
	// Array of GroupStatus
	Groups []*GroupStatusResponseBody `form:"groups,omitempty" json:"groups,omitempty" xml:"groups,omitempty"`
}

TaskListStatusAcceptedResponseBody is the type of the "taskList" service "TaskListStatus" endpoint HTTP response body.

func NewTaskListStatusAcceptedResponseBody

func NewTaskListStatusAcceptedResponseBody(res *tasklist.TaskListStatusResponse) *TaskListStatusAcceptedResponseBody

NewTaskListStatusAcceptedResponseBody builds the HTTP response body from the result of the "TaskListStatus" endpoint of the "taskList" service.

type TaskListStatusCreatedResponseBody

type TaskListStatusCreatedResponseBody struct {
	// Unique taskList identifier.
	ID string `form:"id" json:"id" xml:"id"`
	// Current status of the taskList
	Status string `form:"status" json:"status" xml:"status"`
	// Array of GroupStatus
	Groups []*GroupStatusResponseBody `form:"groups,omitempty" json:"groups,omitempty" xml:"groups,omitempty"`
}

TaskListStatusCreatedResponseBody is the type of the "taskList" service "TaskListStatus" endpoint HTTP response body.

func NewTaskListStatusCreatedResponseBody

func NewTaskListStatusCreatedResponseBody(res *tasklist.TaskListStatusResponse) *TaskListStatusCreatedResponseBody

NewTaskListStatusCreatedResponseBody builds the HTTP response body from the result of the "TaskListStatus" endpoint of the "taskList" service.

type TaskListStatusMultiStatusResponseBody

type TaskListStatusMultiStatusResponseBody struct {
	// Unique taskList identifier.
	ID string `form:"id" json:"id" xml:"id"`
	// Current status of the taskList
	Status string `form:"status" json:"status" xml:"status"`
	// Array of GroupStatus
	Groups []*GroupStatusResponseBody `form:"groups,omitempty" json:"groups,omitempty" xml:"groups,omitempty"`
}

TaskListStatusMultiStatusResponseBody is the type of the "taskList" service "TaskListStatus" endpoint HTTP response body.

func NewTaskListStatusMultiStatusResponseBody

func NewTaskListStatusMultiStatusResponseBody(res *tasklist.TaskListStatusResponse) *TaskListStatusMultiStatusResponseBody

NewTaskListStatusMultiStatusResponseBody builds the HTTP response body from the result of the "TaskListStatus" endpoint of the "taskList" service.

type TaskListStatusOKResponseBody

type TaskListStatusOKResponseBody struct {
	// Unique taskList identifier.
	ID string `form:"id" json:"id" xml:"id"`
	// Current status of the taskList
	Status string `form:"status" json:"status" xml:"status"`
	// Array of GroupStatus
	Groups []*GroupStatusResponseBody `form:"groups,omitempty" json:"groups,omitempty" xml:"groups,omitempty"`
}

TaskListStatusOKResponseBody is the type of the "taskList" service "TaskListStatus" endpoint HTTP response body.

func NewTaskListStatusOKResponseBody

func NewTaskListStatusOKResponseBody(res *tasklist.TaskListStatusResponse) *TaskListStatusOKResponseBody

NewTaskListStatusOKResponseBody builds the HTTP response body from the result of the "TaskListStatus" endpoint of the "taskList" service.

type TaskStatusResponseBody

type TaskStatusResponseBody struct {
	// Unique task identifier.
	ID *string `form:"id,omitempty" json:"id,omitempty" xml:"id,omitempty"`
	// Current status of the task
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
}

TaskStatusResponseBody is used to define fields on response body types.

Jump to

Keyboard shortcuts

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