design

package
v0.0.0-...-eecba0e Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bottle = MediaType("application/vnd.goa.example.com+json", func() {
	Description("A bottle of wine")
	Attributes(func() {
		Attribute("id", Integer, "Unique bottle ID")
		Attribute("href", String, "API href for making requests on the bottle")
		Attribute("name", String, "Name of wine")
		Required("id", "href", "name")
	})
	View("default", func() {
		Attribute("id")
		Attribute("href")
		Attribute("name")
	})
})

Bottle is the Bottle resource media type.

View Source
var Sg = StorageGroup("GoaSampleStorageGroup", func() {
	models := func() {
		Description("This is the Postgres relational store")

		Model("User", func() {
			BuildsFrom(func() {
				Payload("user", "create")

			})
			RendersTo(User)
			Description("User Model Description")
			Field("id", gorma.Integer, func() {
				PrimaryKey()
				Description("This is the User Model PK field")
			})
			Field("title", gorma.String, func() {})
			Field("description", gorma.String, func() {})
		})
	}

	Description("This is the global storage group")
	Store("mysql", gorma.MySQL, models)
})

Sg is StorageGropup of GoaSample

View Source
var User = MediaType("application.vnd.user+json", func() {
	Description("user media type")
	Attributes(func() {
		Attribute("id", Integer, "id")
		Attribute("title", String, "title")
		Attribute("description", String, "description")
		Attribute("created_at", DateTime, "created_at")
		Attribute("updated_at", DateTime, "updated_at")
		Attribute("deleted_at", DateTime, "delted_at")
	})
	View("default", func() {
		Attribute("id")
		Attribute("title")
		Attribute("description")
	})
})

User is the User resource media type.

View Source
var UserPayload = Type("UserPayload", func() {
	Attribute("title", func() {})
	Attribute("description", func() {})
})

UserPayload defines the data structure used in the create user request body. It is also the base type for the user media type used to render users.

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