design

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2020 License: Apache-2.0 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")
		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 is the type used to create bottles")

	Attribute("id", String, "Unique bottle ID", func() {

		ReadOnly()
	})

	Attribute("name", String, "Name of bottle", func() {
		MinLength(1)
	})
	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