design

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ApplyMatchPayload = Type("ApplyMatchPayload", func() {
	Attribute("scores", MapOf(String, Float64), func() {
		Key(RRNDefinition)
		Elem(func() { Example(1.0) })
	})
	Required("scores")
})
View Source
var CreatePlayerPayload = Type("CreatePlayerPayload", func() {
	Attribute("name", String, func() { Example("XRQ85mtXnINISH25zfM0m5RlC6L2") })
	Required("name")
})
View Source
var MatchResponse = ResultType("application/vnd.restrating.match+json", func() {
	Description("Match Response")
	ContentType("application/json")

	Attributes(func() {
		Attribute("participants", ArrayOf(RatingResource))
		Required("participants")
	})

	View("default", func() {
		Attribute("participants")
	})
})
View Source
var RRNDefinition = func() {
	Description("Rating Resource Name")
	Example("rrn:player:XRQ85mtXnINISH25zfM0m5RlC6L2")
}
View Source
var RRNResponse = ResultType("application/vnd.restrating.rrn+json", func() {
	Description("RRN Only Response")
	ContentType("application/json")

	Attributes(func() {
		Attribute("rrn", String, RRNDefinition)
		Required("rrn")
	})

	View("default", func() {
		Attribute("rrn")
	})
})
View Source
var Rating = Type("rating", func() {
	Attribute("strength", Float64, func() {
		Example(1500.0)
	})
	Attribute("lower", Float64, func() {
		Example(1300.0)
	})
	Attribute("upper", Float64, func() {
		Example(1700.0)
	})
	Required("strength", "lower", "upper")
})
View Source
var RatingResource = Type("RatingResource", func() {
	Description("RatingResource describes a strength information.")

	Attribute("rrn", String, "RRN is the unique id of the player/team.", RRNDefinition)
	Attribute("rating", Rating, "players strength")

	Required("rrn", "rating")
})

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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