matches

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

Documentation

Index

Constants

View Source
const ServiceName = "Matches"

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

View Source
var MethodNames = [1]string{"Apply match"}

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 NewApplyMatchEndpoint

func NewApplyMatchEndpoint(s Service) goa.Endpoint

NewApplyMatchEndpoint returns an endpoint function that calls the method "Apply match" of service "Matches".

func NewViewedRestratingMatch

func NewViewedRestratingMatch(res *RestratingMatch, view string) *matchesviews.RestratingMatch

NewViewedRestratingMatch initializes viewed result type RestratingMatch from result type RestratingMatch using the given view.

Types

type ApplyMatchPayload

type ApplyMatchPayload struct {
	Scores map[string]float64
}

ApplyMatchPayload is the payload type of the Matches service Apply match method.

type Client

type Client struct {
	ApplyMatchEndpoint goa.Endpoint
}

Client is the "Matches" service client.

func NewClient

func NewClient(applyMatch goa.Endpoint) *Client

NewClient initializes a "Matches" service client given the endpoints.

func (*Client) ApplyMatch

func (c *Client) ApplyMatch(ctx context.Context, p *ApplyMatchPayload) (res *RestratingMatch, err error)

ApplyMatch calls the "Apply match" endpoint of the "Matches" service.

type Endpoints

type Endpoints struct {
	ApplyMatch goa.Endpoint
}

Endpoints wraps the "Matches" service endpoints.

func NewEndpoints

func NewEndpoints(s Service) *Endpoints

NewEndpoints wraps the methods of the "Matches" service with endpoints.

func (*Endpoints) Use

func (e *Endpoints) Use(m func(goa.Endpoint) goa.Endpoint)

Use applies the given middleware to all the "Matches" service endpoints.

type Rating

type Rating struct {
	Strength float64
	Lower    float64
	Upper    float64
}

type RatingResource

type RatingResource struct {
	// Rating Resource Name
	Rrn string
	// players strength
	Rating *Rating
}

RatingResource describes a strength information.

type RestratingMatch

type RestratingMatch struct {
	Participants []*RatingResource
}

RestratingMatch is the result type of the Matches service Apply match method.

func NewRestratingMatch

func NewRestratingMatch(vres *matchesviews.RestratingMatch) *RestratingMatch

NewRestratingMatch initializes result type RestratingMatch from viewed result type RestratingMatch.

type Service

type Service interface {
	// Apply match and return RatingResources
	ApplyMatch(context.Context, *ApplyMatchPayload) (res *RestratingMatch, err error)
}

Matches serves a learning function of Rating from match results

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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