Documentation
¶
Index ¶
Constants ¶
View Source
const AABBDefinitionName = "AABB"
View Source
const Float2DefinitionName = "Float2"
View Source
const Float3DefinitionName = "Float3"
View Source
const Float4DefinitionName = "Float4"
View Source
const Int2DefinitionName = "Int2"
View Source
const Int3DefinitionName = "Int3"
View Source
const Int4DefinitionName = "Int4"
Variables ¶
View Source
var AABBDefinition = Definition{ Type: "object", Properties: map[string]Property{ "min": { Ref: DefinitionRefPath(Float3DefinitionName), }, "max": { Ref: DefinitionRefPath(Float3DefinitionName), }, }, }
View Source
var Float2Definition = Definition{ Type: "object", Properties: map[string]Property{ "x": floatComponent, "y": floatComponent, }, }
View Source
var Float3Definition = Definition{ Type: "object", Properties: map[string]Property{ "x": floatComponent, "y": floatComponent, "z": floatComponent, }, }
View Source
var Float4Definition = Definition{ Type: "object", Properties: map[string]Property{ "x": floatComponent, "y": floatComponent, "z": floatComponent, "w": floatComponent, }, }
View Source
var Int2Definition = Definition{ Type: "object", Properties: map[string]Property{ "x": intComponent, "y": intComponent, }, }
View Source
var Int3Definition = Definition{ Type: "object", Properties: map[string]Property{ "x": intComponent, "y": intComponent, "z": intComponent, }, }
View Source
var Int4Definition = Definition{ Type: "object", Properties: map[string]Property{ "x": intComponent, "y": intComponent, "z": intComponent, "w": intComponent, }, }
Functions ¶
func DefinitionRefPath ¶
Types ¶
type Definition ¶
type Parameter ¶
type Parameter struct {
// Required. The location of the parameter. Possible values are "query",
// "header", "path", "formData" or "body".
In ParameterLocation `json:"in"`
// Required. The name of the parameter. Parameter names are case sensitive.
// * If in is "path", the name field MUST correspond to the associated
// path segment from the path field in the Paths Object. See Path
// Templating for further information.
// * For all other cases, the name corresponds to the parameter name used
// based on the in property
Name string `json:"name,omitempty"`
// A brief description of the parameter. This could contain examples of
// use. GFM syntax can be used for rich text representation.
Description string `json:"description,omitempty"`
// Determines whether this parameter is mandatory. If the parameter is in
// "path", this property is required and its value MUST be true. Otherwise,
// the property MAY be included and its default value is false.
Required bool `json:"required,omitempty"`
// If in is "body": Required. The schema defining the type used for the
// body parameter.
Schema any `json:"schema,omitempty"`
// If in is any value other than "body"
// Required. The type of the parameter. Since the parameter is not located
// at the request body, it is limited to simple types (that is, not an
// object). The value MUST be one of "string", "number", "integer",
// "boolean", "array" or "file". If type is "file", the consumes MUST be
// either "multipart/form-data", " application/x-www-form-urlencoded" or
// both and the parameter MUST be in "formData".
Type string `json:"type,omitempty"`
}
type ParameterLocation ¶
type ParameterLocation string
const ( PathParameterLocation ParameterLocation = "path" QueryParameterLocation ParameterLocation = "query" HeaderParameterLocation ParameterLocation = "header" BodyParameterLocation ParameterLocation = "body" FormParameterLocation ParameterLocation = "formData" )
type Path ¶
type Path map[RequestMethod]RequestDefinition
type Property ¶
type Property struct {
Type PropertyType `json:"type,omitempty"`
// An optional format modifier serves as a hint at the contents and format
// of the string
Format PropertyFormat `json:"format,omitempty"`
Example any `json:"example,omitempty"`
Ref any `json:"$ref,omitempty"`
Description any `json:"description,omitempty"`
Items any `json:"items,omitempty"`
// If type is object
Properties []Property `json:"properties,omitempty"`
}
type PropertyFormat ¶
type PropertyFormat string
const ( Int32PropertyFormat PropertyFormat = "int32" Int64PropertyFormat PropertyFormat = "int64" FloatPropertyFormat PropertyFormat = "float" DoublePropertyFormat PropertyFormat = "double" // Base64-encoded characters, for example, U3dhZ2dlciByb2Nrcw== BytePropertyFormat PropertyFormat = "byte" // Binary data, used to describe files BinaryPropertyFormat PropertyFormat = "binary" // Full-date notation as defined by RFC 3339, section 5.6, for example, // 2017-07-21 DatePropertyFormat PropertyFormat = "date" // The date-time notation as defined by RFC 3339, section 5.6, for example, // 2017-07-21T17:32:28Z DateTimePropertyFormat PropertyFormat = "date-time" // A hint to UIs to mask the input PasswordPropertyFormat PropertyFormat = "password" )
type PropertyType ¶
type PropertyType string
const ( ObjectPropertyType PropertyType = "object" StringPropertyType PropertyType = "string" IntegerPropertyType PropertyType = "integer" NumberPropertyType PropertyType = "number" BooleanPropertyType PropertyType = "boolean" ArrayPropertyType PropertyType = "array" )
type RequestDefinition ¶
type RequestMethod ¶
type RequestMethod string
const ( GetRequestMethod RequestMethod = "get" PostRequestMethod RequestMethod = "post" )
type SchemaObject ¶
type SchemaObject struct {
Ref string `json:"$ref,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.