public

package
v0.0.0-...-3c3b521 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Address = Type("Address", func() {
	Description("Address is a street address")
	Attribute("number", Integer, "Street number", func() {
		Minimum(1)
	})
	Attribute("street", String, "Street name", func() {
		MinLength(1)
	})
	Attribute("city", String, "City", func() {
		MinLength(1)
	})
	Attribute("state", String, "US State Code", func() {
		MinLength(2)
		MaxLength(2)
	})
	Attribute("zip", Integer, "US Zip code", func() {
		Minimum(10000)
		Maximum(99999)
	})
	Required("number", "street", "city", "state", "zip")
})

Address is the type used to represent street addresses.

View Source
var CourseMedia = MediaType("application/vnd.goworkshop.course+json", func() {
	Description("CourseMedia is the media type used to render courses")
	TypeName("CourseMedia")
	Reference(CoursePayload)

	Attributes(func() {
		Attribute("id", Integer, "Course identifier")
		Attribute("href", String, "Course href")
		Attribute("name")
		Attribute("description")
		Attribute("start_time")
		Attribute("end_time")
		Attribute("location")
		Required("id", "href", "name", "start_time", "end_time", "location")
	})

	View("default", func() {
		Attribute("id")
		Attribute("href")
		Attribute("name")
		Attribute("description")
		Attribute("start_time")
		Attribute("end_time")
		Attribute("location")
	})

	View("link", func() {
		Attribute("id")
		Attribute("href")
	})
})

CourseMedia is the media type used to render courses.

View Source
var CoursePayload = Type("CoursePatchPayload", func() {
	Description("CoursePayload is the type used to create courses")
	Attribute("name", String, "Course name", func() {
		MinLength(3)
	})
	Attribute("description", String, "Course description")
	Attribute("start_time", DateTime, "Course start date/time")
	Attribute("end_time", DateTime, "Course end date/time")
	Attribute("location", String, "Course location", func() {
		MinLength(2)
	})
	Required("name", "start_time", "end_time", "location")
})

CoursePayload is the type used to create courses.

View Source
var RegistrationMedia = MediaType("application/vnd.goworkshop.registration+json", func() {
	Description("RegistrationMedia is the media type used to render registrations")
	TypeName("RegistrationMedia")
	Reference(RegistrationPayload)

	Attributes(func() {
		Attribute("id", Integer, "Registration identifier")
		Attribute("href", String, "Registration href")
		Attribute("course", CourseMedia, "Course being taught")
		Attribute("first_name")
		Attribute("last_name")
		Attribute("address")
		Link("course")
		Required("id", "href", "course", "first_name", "last_name", "address")
	})

	View("default", func() {
		Attribute("id")
		Attribute("href")
		Attribute("first_name")
		Attribute("last_name")
		Attribute("address")
		Attribute("links")
	})
})

RegistrationMedia is the media type used to render registrations.

View Source
var RegistrationPayload = Type("RegistrationPayload", func() {
	Description("RegistrationPayload is the type used to create registrations")
	Attribute("course_href", String, "The href to the course resource that describes the course being taught", func() {
		Pattern("/courses/[0-9]+")
	})
	Attribute("first_name", String, "Attendee first name", func() {
		MinLength(2)
	})
	Attribute("last_name", String, "Attendee last name", func() {
		MinLength(2)
	})
	Attribute("address", Address, "Attendee address")
	Required("course_href", "first_name", "last_name", "address")
})

RegistrationPayload is the type used to create registrations.

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