# Packages
Package test contains a self-contained DSL test.
# Functions
AccessCodeFlow defines an "access code" OAuth2 flow.
Action implements the action definition DSL.
API implements the top level API DSL.
APIKeySecurity defines an "apiKey" security scheme available throughout the API.
ApplicationFlow defines an "application" OAuth2 flow.
ArrayOf creates an array type from its element type.
Attribute can be used in: View, Type, Attribute, Attributes
Attribute implements the attribute definition DSL.
Attributes implements the media type attributes apidsl.
BasePath defines the API base path, i.e.
BasicAuthSecurity defines a "basic" security scheme for the API.
CanonicalActionName sets the name of the action used to compute the resource collection and resource collection items hrefs.
CollectionOf creates a collection media type from its element media type and an optional identifier.
CONNECT creates a route using the CONNECT HTTP method.
Consumes adds a MIME type to the list of MIME types the APIs supports when accepting requests.
Contact sets the API contact information.
ContentType sets the value of the Content-Type response header.
Credentials sets the allow credentials response header.
Default can be used in: Attribute
Default sets the default value for an attribute.
DefaultMedia sets a resource default media type by identifier or by reference using a value returned by MediaType:
var _ = Resource("bottle", func() { DefaultMedia(BottleMedia) // ..
DELETE creates a route using the DELETE HTTP method.
Description sets the definition description.
Docs provides external documentation pointers.
Email sets the contact email.
Enum can be used in: Attribute, Header, Param, HashOf, ArrayOf
Enum adds a "enum" validation to the attribute.
Example can be used in: Attribute, Header, Param, HashOf, ArrayOf
Example sets the example of an attribute to be used for the documentation:
Attributes(func() { Attribute("ID", Integer, func() { Example(1) }) Attribute("name", String, func() { Example("Cabernet Sauvignon") }) Attribute("price", String) //If no Example() is provided, goa generates one that fits your specification })
If you do not want an auto-generated example for an attribute, add NoExample() to it.
Expose sets the origin exposed headers.
Files defines an API endpoint that serves static assets.
Format can be used in: Attribute, Header, Param, HashOf, ArrayOf
Format adds a "format" validation to the attribute.
Function sets the Go function name used to instantiate the encoder or decoder.
GET creates a route using the GET HTTP method.
HashOf creates a hash map from its key and element types.
HEAD creates a route using the HEAD HTTP method.
Header can be used in: Headers, APIKeySecurity, JWTSecurity
Header is an alias of Attribute for the most part.
Headers implements the DSL for describing HTTP headers.
Host sets the API hostname.
ImplicitFlow defines an "implicit" OAuth2 flow.
JWTSecurity defines an APIKey security scheme, with support for Scopes and a TokenURL.
License sets the API license information.
Link adds a link to a media type.
Links implements the media type links apidsl.
MaxAge sets the cache expiry for preflight request responses.
Maximum can be used in: Attribute, Header, Param, HashOf, ArrayOf
Maximum adds a "maximum" validation to the attribute.
MaxLength can be used in: Attribute, Header, Param, HashOf, ArrayOf
MaxLength adds a "maxItems" validation to the attribute.
Media sets a response media type by name or by reference using a value returned by MediaType:
Response("NotFound", func() { Status(404) Media("application/json") })
If Media uses a media type defined in the design then it may optionally specify a view name:
Response("OK", func() { Status(200) Media(BottleMedia, "tiny") })
Specifying a media type is useful for responses that always return the same view.
MediaType is a top level DSL which can also be used in ResponseTemplate.
Member can be used in: Payload
Member is an alias of Attribute.
Metadata is a set of key/value pairs that can be assigned to an object.
Methods sets the origin allowed methods.
Minimum can be used in: Attribute, Header, Param, HashOf, ArrayOf
Minimum adds a "minimum" validation to the attribute.
MinLength can be used in: Attribute, Header, Param, HashOf, ArrayOf
MinLength adds a "minItems" validation to the attribute.
MultipartForm can be used in: Action
MultipartForm implements the action multipart form DSL.
Name sets the contact or license name.
NoExample can be used in: Attribute, Header, Param, HashOf, ArrayOf
NoExample sets the example of an attribute to be blank for the documentation.
NoSecurity resets the authentication schemes for an Action or a Resource.
OAuth2Security defines an OAuth2 security scheme.
OptionalPayload implements the action optional payload DSL.
OPTIONS creates a route using the OPTIONS HTTP method.
Origin defines the CORS policy for a given origin.
Package sets the Go package path to the encoder or decoder.
Param can be used in: Params
Param is an alias of Attribute.
Params describe the action parameters, either path parameters identified via wildcards or query string parameters if there is no corresponding path parameter.
Parent sets the resource parent.
PasswordFlow defines a "password" OAuth2 flow.
PATCH creates a route using the PATCH HTTP method.
Pattern can be used in: Attribute, Header, Param, HashOf, ArrayOf
Pattern adds a "pattern" validation to the attribute.
Payload implements the action payload DSL.
POST creates a route using the POST HTTP method.
Produces adds a MIME type to the list of MIME types the APIs can encode responses with.
PUT creates a route using the PUT HTTP method.
Query defines that an APIKeySecurity or JWTSecurity implementation must check in the query parameter named "parameterName" to get the api key.
ReadOnly can be used in: Attribute ReadOnly sets the readOnly property of an attribute to true.
Reference sets a type or media type reference.
Required can be used in: Attributes, Headers, Payload, Type, Params
Required adds a "required" validation to the attribute.
Resource implements the resource definition dsl.
Response implements the response definition DSL.
ResponseTemplate defines a response template that action definitions can use to describe their responses.
Routing lists the action route.
Scheme sets the API URL schemes.
Scope defines an authorization scope.
Security defines an authentication requirements to access a goa Action.
Status sets the Response status.
TermsOfService describes the API terms of services or links to them.
Title sets the API title used by generated documentation, JSON Hyper-schema, code comments etc.
TokenURL defines a URL to get an access token.
TRACE creates a route using the TRACE HTTP method.
Trait defines an API trait.
Type implements the type definition dsl.
TypeName can be used in: MediaType
TypeName makes it possible to set the Go struct name for a media type in the generated code.
URL can be used in: Contact, License, Docs
URL sets the contact, license, or Docs URL.
UseTrait executes the API trait with the given name.
Version specifies the API version.
View can be used in: MediaType, Response
View adds a new view to a media type.
# Variables
SupportedValidationFormats lists the supported formats for use with the Format DSL.