server

package
v0.0.0-...-998107f Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyMatchMatchesPath

func ApplyMatchMatchesPath() string

ApplyMatchMatchesPath returns the URL path to the Matches service Apply match HTTP endpoint.

func DecodeApplyMatchRequest

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

DecodeApplyMatchRequest returns a decoder for requests sent to the Matches Apply match endpoint.

func EncodeApplyMatchResponse

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

EncodeApplyMatchResponse returns an encoder for responses returned by the Matches Apply match endpoint.

func Mount

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

Mount configures the mux to serve the Matches endpoints.

func MountApplyMatchHandler

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

MountApplyMatchHandler configures the mux to serve the "Matches" service "Apply match" endpoint.

func NewApplyMatchHandler

func NewApplyMatchHandler(
	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

NewApplyMatchHandler creates a HTTP handler which loads the HTTP request and calls the "Matches" service "Apply match" endpoint.

func NewApplyMatchPayload

func NewApplyMatchPayload(body *ApplyMatchRequestBody) *matches.ApplyMatchPayload

NewApplyMatchPayload builds a Matches service Apply match endpoint payload.

func ValidateApplyMatchRequestBody

func ValidateApplyMatchRequestBody(body *ApplyMatchRequestBody) (err error)

ValidateApplyMatchRequestBody runs the validations defined on Apply MatchRequestBody

func ValidateRatingResourceResponseBody

func ValidateRatingResourceResponseBody(body *RatingResourceResponseBody) (err error)

ValidateRatingResourceResponseBody runs the validations defined on RatingResourceResponseBody

Types

type ApplyMatchRequestBody

type ApplyMatchRequestBody struct {
	Scores map[string]float64 `form:"scores,omitempty" json:"scores,omitempty" xml:"scores,omitempty"`
}

ApplyMatchRequestBody is the type of the "Matches" service "Apply match" endpoint HTTP request body.

type ApplyMatchResponseBody

type ApplyMatchResponseBody struct {
	Participants []*RatingResourceResponseBody `form:"participants" json:"participants" xml:"participants"`
}

ApplyMatchResponseBody is the type of the "Matches" service "Apply match" endpoint HTTP response body.

func NewApplyMatchResponseBody

func NewApplyMatchResponseBody(res *matchesviews.RestratingMatchView) *ApplyMatchResponseBody

NewApplyMatchResponseBody builds the HTTP response body from the result of the "Apply match" endpoint of the "Matches" 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 RatingResourceResponseBody

type RatingResourceResponseBody struct {
	// Rating Resource Name
	Rrn string `form:"rrn" json:"rrn" xml:"rrn"`
	// players strength
	Rating *RatingResponseBody `form:"rating" json:"rating" xml:"rating"`
}

RatingResourceResponseBody is used to define fields on response body types.

type RatingResponseBody

type RatingResponseBody struct {
	Strength float64 `form:"strength" json:"strength" xml:"strength"`
	Lower    float64 `form:"lower" json:"lower" xml:"lower"`
	Upper    float64 `form:"upper" json:"upper" xml:"upper"`
}

RatingResponseBody is used to define fields on response body types.

type Server

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

Server lists the Matches service endpoint HTTP handlers.

func New

New instantiates HTTP handlers for all the Matches 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