design

package
v0.0.0-...-a15f217 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BottleMedia = MediaType("application/vnd.gophercon.goa.bottle", func() {
	TypeName("bottle")
	Reference(BottlePayload)

	Attributes(func() {
		Attribute("ID", Integer, "Unique bottle ID")
		Attribute("name")
		Attribute("vintage")
		Attribute("rating")
		Required("ID", "name", "vintage", "rating")
	})

	View("default", func() {
		Attribute("ID")
		Attribute("name")
		Attribute("vintage")
		Attribute("rating")
	})
})
View Source
var BottlePayload = Type("BottlePayload", func() {
	Description("BottlePayload that creates bottles")

	Attribute("name", String, "Name of bottle", func() {
		MinLength(2)
	})

	Attribute("vintage", Integer, "Vintage of bottle", func() {
		Minimum(1900)
	})

	Attribute("rating", Integer, "Rating of bottle", func() {
		Minimum(1)
		Maximum(5)
	})
	Required("name", "vintage", "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