Documentation ¶
Index ¶
Constants ¶
const ServiceName = "Players"
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 ¶
var MethodNames = [1]string{"create player"}
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 NewCreatePlayerEndpoint ¶
NewCreatePlayerEndpoint returns an endpoint function that calls the method "create player" of service "Players".
func NewViewedRestratingRrn ¶
func NewViewedRestratingRrn(res *RestratingRrn, view string) *playersviews.RestratingRrn
NewViewedRestratingRrn initializes viewed result type RestratingRrn from result type RestratingRrn using the given view.
Types ¶
type Client ¶
Client is the "Players" service client.
func (*Client) CreatePlayer ¶
func (c *Client) CreatePlayer(ctx context.Context, p *CreatePlayerPayload) (res *RestratingRrn, err error)
CreatePlayer calls the "create player" endpoint of the "Players" service.
type CreatePlayerPayload ¶
type CreatePlayerPayload struct {
Name string
}
CreatePlayerPayload is the payload type of the Players service create player method.
type Endpoints ¶
Endpoints wraps the "Players" service endpoints.
func NewEndpoints ¶
NewEndpoints wraps the methods of the "Players" service with endpoints.
type RestratingRrn ¶
type RestratingRrn struct { // Rating Resource Name Rrn string }
RestratingRrn is the result type of the Players service create player method.
func NewRestratingRrn ¶
func NewRestratingRrn(vres *playersviews.RestratingRrn) *RestratingRrn
NewRestratingRrn initializes result type RestratingRrn from viewed result type RestratingRrn.
type Service ¶
type Service interface { // Add new player and return its RRN(Rating Resource Name). CreatePlayer(context.Context, *CreatePlayerPayload) (res *RestratingRrn, err error) }
Player serves an indicator of strength using Rating