server

package
v0.0.0-...-83043b2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2019 License: GPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddIndexesPath

func AddIndexesPath() string

AddIndexesPath returns the URL path to the indexes service add HTTP endpoint.

func DecodeAddRequest

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

DecodeAddRequest returns a decoder for requests sent to the indexes add endpoint.

func DecodeRemoveRequest

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

DecodeRemoveRequest returns a decoder for requests sent to the indexes remove endpoint.

func EncodeAddError

EncodeAddError returns an encoder for errors returned by the add indexes endpoint.

func EncodeAddResponse

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

EncodeAddResponse returns an encoder for responses returned by the indexes add endpoint.

func EncodeListError

EncodeListError returns an encoder for errors returned by the list indexes endpoint.

func EncodeListResponse

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

EncodeListResponse returns an encoder for responses returned by the indexes list endpoint.

func EncodeRemoveError

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

EncodeRemoveError returns an encoder for errors returned by the remove indexes endpoint.

func EncodeRemoveResponse

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

EncodeRemoveResponse returns an encoder for responses returned by the indexes remove endpoint.

func ListIndexesPath

func ListIndexesPath() string

ListIndexesPath returns the URL path to the indexes service list HTTP endpoint.

func Mount

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

Mount configures the mux to serve the indexes endpoints.

func MountAddHandler

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

MountAddHandler configures the mux to serve the "indexes" service "add" endpoint.

func MountListHandler

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

MountListHandler configures the mux to serve the "indexes" service "list" endpoint.

func MountRemoveHandler

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

MountRemoveHandler configures the mux to serve the "indexes" service "remove" endpoint.

func NewAddHandler

func NewAddHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewAddHandler creates a HTTP handler which loads the HTTP request and calls the "indexes" service "add" endpoint.

func NewAddIndexPayload

func NewAddIndexPayload(body *AddRequestBody) *indexes.IndexPayload

NewAddIndexPayload builds a indexes service add endpoint payload.

func NewListHandler

func NewListHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewListHandler creates a HTTP handler which loads the HTTP request and calls the "indexes" service "list" endpoint.

func NewRemoveHandler

func NewRemoveHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	dec func(*http.Request) goahttp.Decoder,
	enc func(context.Context, http.ResponseWriter) goahttp.Encoder,
	eh func(context.Context, http.ResponseWriter, error),
) http.Handler

NewRemoveHandler creates a HTTP handler which loads the HTTP request and calls the "indexes" service "remove" endpoint.

func NewRemoveIndexPayload

func NewRemoveIndexPayload(body *RemoveRequestBody) *indexes.IndexPayload

NewRemoveIndexPayload builds a indexes service remove endpoint payload.

func RemoveIndexesPath

func RemoveIndexesPath() string

RemoveIndexesPath returns the URL path to the indexes service remove HTTP endpoint.

func ValidateAddRequestBody

func ValidateAddRequestBody(body *AddRequestBody) (err error)

ValidateAddRequestBody runs the validations defined on AddRequestBody

func ValidateRemoveRequestBody

func ValidateRemoveRequestBody(body *RemoveRequestBody) (err error)

ValidateRemoveRequestBody runs the validations defined on RemoveRequestBody

Types

type AddInvalidURLResponseBody

type AddInvalidURLResponseBody 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"`
}

AddInvalidURLResponseBody is the type of the "indexes" service "add" endpoint HTTP response body for the "invalid_url" error.

func NewAddInvalidURLResponseBody

func NewAddInvalidURLResponseBody(res *goa.ServiceError) *AddInvalidURLResponseBody

NewAddInvalidURLResponseBody builds the HTTP response body from the result of the "add" endpoint of the "indexes" service.

type AddRequestBody

type AddRequestBody struct {
	// The url of the index file
	URL *string `form:"url,omitempty" json:"url,omitempty" xml:"url,omitempty"`
}

AddRequestBody is the type of the "indexes" service "add" endpoint HTTP request body.

type AddResponseBody

type AddResponseBody struct {
	// The status of the operation
	Status string `form:"status" json:"status" xml:"status"`
}

AddResponseBody is the type of the "indexes" service "add" endpoint HTTP response body.

func NewAddResponseBody

func NewAddResponseBody(res *indexesviews.OperationView) *AddResponseBody

NewAddResponseBody builds the HTTP response body from the result of the "add" endpoint of the "indexes" 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 ListInvalidURLResponseBody

type ListInvalidURLResponseBody 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"`
}

ListInvalidURLResponseBody is the type of the "indexes" service "list" endpoint HTTP response body for the "invalid_url" error.

func NewListInvalidURLResponseBody

func NewListInvalidURLResponseBody(res *goa.ServiceError) *ListInvalidURLResponseBody

NewListInvalidURLResponseBody builds the HTTP response body from the result of the "list" endpoint of the "indexes" service.

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 RemoveInvalidURLResponseBody

type RemoveInvalidURLResponseBody 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"`
}

RemoveInvalidURLResponseBody is the type of the "indexes" service "remove" endpoint HTTP response body for the "invalid_url" error.

func NewRemoveInvalidURLResponseBody

func NewRemoveInvalidURLResponseBody(res *goa.ServiceError) *RemoveInvalidURLResponseBody

NewRemoveInvalidURLResponseBody builds the HTTP response body from the result of the "remove" endpoint of the "indexes" service.

type RemoveRequestBody

type RemoveRequestBody struct {
	// The url of the index file
	URL *string `form:"url,omitempty" json:"url,omitempty" xml:"url,omitempty"`
}

RemoveRequestBody is the type of the "indexes" service "remove" endpoint HTTP request body.

type RemoveResponseBody

type RemoveResponseBody struct {
	// The status of the operation
	Status string `form:"status" json:"status" xml:"status"`
}

RemoveResponseBody is the type of the "indexes" service "remove" endpoint HTTP response body.

func NewRemoveResponseBody

func NewRemoveResponseBody(res *indexesviews.OperationView) *RemoveResponseBody

NewRemoveResponseBody builds the HTTP response body from the result of the "remove" endpoint of the "indexes" service.

type Server

type Server struct {
	Mounts []*MountPoint
	List   http.Handler
	Add    http.Handler
	Remove http.Handler
}

Server lists the indexes service endpoint HTTP handlers.

func New

New instantiates HTTP handlers for all the indexes service 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.

Jump to

Keyboard shortcuts

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