Documentation
¶
Index ¶
- Constants
- func GetSecurity(secSchemes openapi3.SecuritySchemes, ...) ([][]Security, error)
- type Components
- type ComponentsSchemas
- type Contact
- type CookieParameter
- type HTTPMethod
- type HTTPMethodTitle
- type Header
- type HeaderOld
- type HeaderParameter
- type HeaderParameterOld
- type Info
- type License
- type Link
- type Map
- func NewMap[T any, U any](m map[string]U, fn func(U) T) Map[T]
- func NewMapEmpty[T any](size int) Map[T]
- func NewMapPrefix[T any, U any](m map[string]U, fn func(U) T, prefix RefKey) Map[T]
- func NewMapRefSelf[T any, U any](m map[string]U, fn func(U) (ref string, _ Ref[T]), prefix RefKey) Map[Ref[T]]
- func NewMapRefSelfSource[T any, U any](m map[string]U, fn func(U, Map[Ref[T]]) (ref string, _ Ref[T]), ...) Map[Ref[T]]
- func NewMapRefSource[T any, U any](m map[string]U, fn func(U) (ref string, _ Ref[T]), source Sourcer[T], ...) Map[Ref[T]]
- type Maybe
- type MediaType
- type NoRef
- type OAuthFlow
- type OAuthFlows
- type Object
- type Operation
- type OperationParameters
- type Path
- type PathDir
- type PathDirOld
- type PathItem
- type PathOld2
- type PathParameter
- type PathParameterOld
- type PathParameters
- type Prefix
- type QueryParameter
- type QueryParameterOld
- type Ref
- func NewRefCookieParam(p *openapi3.ParameterRef, components Components) Ref[CookieParameter]
- func NewRefHeaderParam(p *openapi3.ParameterRef, components Components) Ref[HeaderParameter]
- func NewRefPathParam(p *openapi3.ParameterRef, components Components) Ref[PathParameter]
- func NewRefQueryParam(p *openapi3.ParameterRef, components Components) Ref[QueryParameter]
- func NewSchemaRef(schema *openapi3.SchemaRef, components ComponentsSchemas) Ref[Schema]
- type RefKey
- type RefObject
- type RequestBody
- type Response
- type ResponseOld
- type ResponseUsedIn
- type Schema
- type SchemaProperty
- type Security
- type SecurityRequirement
- type SecurityRequirements
- type SecurityScheme
- type SecuritySchemeIn
- type SecuritySchemeType
- type SecuritySchemes
- type Server
- type ServerVariable
- type Sourcer
- type SourcerFunc
- type Spec
Constants ¶
View Source
const ExtTagGoType = "x-goag-go-type"
Variables ¶
This section is empty.
Functions ¶
func GetSecurity ¶ added in v0.0.12
func GetSecurity(secSchemes openapi3.SecuritySchemes, secRequirements openapi3.SecurityRequirements) ([][]Security, error)
Types ¶
type Components ¶ added in v0.0.11
type Components struct {
Schemas ComponentsSchemas
Headers Map[Ref[Header]]
RequestBodies Map[Ref[RequestBody]]
Responses Map[Ref[Response]]
// ---------------- Parameters ----------------
QueryParameters Map[Ref[QueryParameter]]
HeaderParameters Map[Ref[HeaderParameter]]
PathParameters Map[Ref[PathParameter]]
CookieParameters Map[Ref[CookieParameter]]
SecuritySchemes SecuritySchemes
Links Map[Ref[Link]]
PathItems Map[Ref[PathItem]]
}
func NewComponents ¶ added in v0.0.11
func NewComponents(spec openapi3.Components) (zero Components, _ error)
type ComponentsSchemas ¶ added in v0.0.14
type Contact ¶ added in v0.0.14
func NewContact ¶ added in v0.0.14
type CookieParameter ¶ added in v0.0.14
type CookieParameter struct {
NoRef[CookieParameter]
Name string
Description string
Required bool
Deprecated bool
Style string
Explode Maybe[bool]
Schema Ref[Schema]
}
func NewCookieParameter ¶ added in v0.0.14
func NewCookieParameter(p *openapi3.Parameter, schemas ComponentsSchemas) *CookieParameter
func (*CookieParameter) Value ¶ added in v0.0.14
func (c *CookieParameter) Value() *CookieParameter
type HTTPMethod ¶ added in v0.0.14
type HTTPMethod string
HTTPMethod - http.MethodGet, http.MethodPost, ...
type HTTPMethodTitle ¶ added in v0.0.14
type HTTPMethodTitle string
HTTPMethodTitle - Get, Post, ...
type Header ¶
type HeaderOld ¶ added in v0.0.14
type HeaderParameter ¶
type HeaderParameter struct {
NoRef[HeaderParameter]
Name string
Description string
Required bool
Deprecated bool
Style string
Explode Maybe[bool]
Schema Ref[Schema]
}
func NewHeaderParameter ¶ added in v0.0.14
func NewHeaderParameter(p *openapi3.Parameter, schemas ComponentsSchemas) *HeaderParameter
func (*HeaderParameter) Value ¶ added in v0.0.14
func (h *HeaderParameter) Value() *HeaderParameter
type HeaderParameterOld ¶ added in v0.0.14
type Info ¶ added in v0.0.10
type License ¶ added in v0.0.14
func NewLicense ¶ added in v0.0.14
type Map ¶ added in v0.0.14
func NewMapEmpty ¶ added in v0.0.14
func NewMapPrefix ¶ added in v0.0.14
func NewMapRefSelf ¶ added in v0.0.14
func NewMapRefSelfSource ¶ added in v0.0.14
func NewMapRefSource ¶ added in v0.0.14
type MediaType ¶ added in v0.0.14
func NewMediaType ¶ added in v0.0.14
func NewMediaType(s *openapi3.MediaType, components ComponentsSchemas) *MediaType
type OAuthFlow ¶ added in v0.0.14
type OAuthFlow struct {
AuthorizationURL string
TokenURL string
RefreshURL string
Scopes Map[string]
}
func NewOAuthFlow ¶ added in v0.0.14
type OAuthFlows ¶ added in v0.0.14
type OAuthFlows struct {
Implicit Maybe[OAuthFlow]
Password Maybe[OAuthFlow]
ClientCredentials Maybe[OAuthFlow]
AuthorizationCode Maybe[OAuthFlow]
}
func NewOAuthFlows ¶ added in v0.0.14
func NewOAuthFlows(s *openapi3.OAuthFlows) OAuthFlows
type Operation ¶
type Operation struct {
PathItem *PathItem
Path Path
Tags []string
Summary string
Description string
OperationID string
Parameters OperationParameters
RequestBody Maybe[Ref[RequestBody]]
HTTPMethod HTTPMethod
Method HTTPMethodTitle
Operation *openapi3.Operation
Security SecurityRequirements
Responses Map[Ref[Response]]
}
func NewOperation ¶
func NewOperation(pi *PathItem, rawPath string, method httpMethod, operation *openapi3.Operation, specSecurityReqs SecurityRequirements, legacyComponents openapi3.Components, securitySchemes SecuritySchemes, components Components) (*Operation, error)
type OperationParameters ¶ added in v0.0.14
type OperationParameters struct {
Query Map[Ref[QueryParameter]]
Headers Map[Ref[HeaderParameter]]
Path Map[Ref[PathParameter]]
Cookie Map[Ref[CookieParameter]]
}
func NewOperationParameters ¶ added in v0.0.14
func NewOperationParameters(pathParams, operationParams openapi3.Parameters, components Components) OperationParameters
type PathDirOld ¶ added in v0.0.14
type PathDirOld struct {
Raw Prefix
ParamRef *PathParameterOld
}
type PathItem ¶
type PathItem struct {
NoRef[PathItem]
RawPath string // TODO
Operations []*Operation
// Deprecated // TODO
Path PathOld2
PathItem *openapi3.PathItem
}
func NewPathItem ¶ added in v0.0.14
func (*PathItem) GetOperation ¶ added in v0.1.14
func (p *PathItem) GetOperation(m HTTPMethod) (*Operation, bool)
func (*PathItem) HasOperation ¶ added in v0.1.14
func (p *PathItem) HasOperation(m HTTPMethod) bool
type PathOld2 ¶ added in v0.0.14
type PathOld2 struct {
Spec string
Dirs []*PathDirOld
Params PathParameters
}
func NewPathOld2 ¶ added in v0.0.14
type PathParameter ¶
type PathParameter struct {
NoRef[PathParameter]
Name string
Description string
Deprecated bool
Style string
Explode Maybe[bool]
Schema Ref[Schema]
}
func NewPathParameter ¶ added in v0.0.14
func NewPathParameter(p *openapi3.Parameter, schemas ComponentsSchemas) *PathParameter
func (*PathParameter) Value ¶ added in v0.0.14
func (p *PathParameter) Value() *PathParameter
type PathParameterOld ¶ added in v0.0.14
type PathParameters ¶
type PathParameters []*PathParameterOld
func (PathParameters) Get ¶
func (ps PathParameters) Get(name string) (*PathParameterOld, bool)
type QueryParameter ¶
type QueryParameter struct {
NoRef[QueryParameter]
Name string
Description string
Required bool
Deprecated bool
AllowEmptyValue bool
Style string
Explode Maybe[bool]
AllowReserved bool
Schema Ref[Schema]
}
func NewQueryParameter ¶ added in v0.0.14
func NewQueryParameter(p *openapi3.Parameter, schemas ComponentsSchemas) *QueryParameter
func (*QueryParameter) Value ¶ added in v0.0.14
func (q *QueryParameter) Value() *QueryParameter
type QueryParameterOld ¶ added in v0.0.14
type Ref ¶ added in v0.0.14
func NewRefCookieParam ¶ added in v0.0.14
func NewRefCookieParam(p *openapi3.ParameterRef, components Components) Ref[CookieParameter]
func NewRefHeaderParam ¶ added in v0.0.14
func NewRefHeaderParam(p *openapi3.ParameterRef, components Components) Ref[HeaderParameter]
func NewRefPathParam ¶ added in v0.0.14
func NewRefPathParam(p *openapi3.ParameterRef, components Components) Ref[PathParameter]
func NewRefQueryParam ¶ added in v0.0.14
func NewRefQueryParam(p *openapi3.ParameterRef, components Components) Ref[QueryParameter]
func NewSchemaRef ¶ added in v0.0.14
func NewSchemaRef(schema *openapi3.SchemaRef, components ComponentsSchemas) Ref[Schema]
type RefObject ¶ added in v0.0.14
func NewRefObject ¶ added in v0.0.14
func NewRefObjectSource ¶ added in v0.0.14
type RequestBody ¶ added in v0.0.14
type RequestBody struct {
NoRef[RequestBody]
Description string
Content Map[*MediaType]
Required bool
}
func NewRequestBody ¶ added in v0.0.14
func NewRequestBody(r *openapi3.RequestBody, components ComponentsSchemas) *RequestBody
func (*RequestBody) Value ¶ added in v0.0.14
func (r *RequestBody) Value() *RequestBody
type Response ¶
type Response struct {
NoRef[Response]
Description string
Headers Map[Ref[Header]]
Content Map[*MediaType]
Links Map[Ref[Link]]
UsedIn []ResponseUsedIn
}
func NewResponse ¶
func NewResponse(s *openapi3.Response, components Components) *Response
type ResponseOld ¶ added in v0.0.14
type ResponseOld struct {
StatusCode string
Operation *Operation
Spec *openapi3.Response
RefName string
Headers []HeaderOld
}
func NewResponseOld ¶ added in v0.0.14
func NewResponseOld(responseStatusCode string, o *Operation, r *openapi3.ResponseRef) *ResponseOld
type ResponseUsedIn ¶ added in v0.1.8
type Schema ¶
type SchemaProperty ¶ added in v0.0.11
type Security ¶ added in v0.0.12
type Security struct {
Requirement []string
Scheme openapi3.SecurityScheme
}
type SecurityRequirement ¶ added in v0.0.14
type SecurityRequirement struct {
Scheme *SecurityScheme
Requirements []string
}
func NewSecurityRequirement ¶ added in v0.0.14
func NewSecurityRequirement(k string, v []string, schemes SecuritySchemes) SecurityRequirement
func NewSecurityRequirements ¶ added in v0.0.14
func NewSecurityRequirements(s openapi3.SecurityRequirements, schemes SecuritySchemes) []SecurityRequirement
type SecurityRequirements ¶ added in v0.0.14
type SecurityRequirements []SecurityRequirement
type SecurityScheme ¶ added in v0.0.14
type SecurityScheme struct {
NoRef[SecurityScheme]
// Any
Type SecuritySchemeType
Description string
// apiKey
Name string
In SecuritySchemeIn
// http
Scheme string
BearerFormat string
// oauth2
Flows OAuthFlows
// openIdConnect
OpenIDConnectURL string
}
func NewSecurityScheme ¶ added in v0.0.14
func NewSecurityScheme(s *openapi3.SecurityScheme) *SecurityScheme
func (*SecurityScheme) Value ¶ added in v0.0.14
func (s *SecurityScheme) Value() *SecurityScheme
type SecuritySchemeIn ¶ added in v0.0.14
type SecuritySchemeIn string
const ( SecuritySchemeInQuery SecuritySchemeIn = "query" SecuritySchemeInHeader SecuritySchemeIn = "header" SecuritySchemeInCookie SecuritySchemeIn = "cookie" )
type SecuritySchemeType ¶ added in v0.0.14
type SecuritySchemeType string
const ( SecuritySchemeTypeApiKey SecuritySchemeType = "apiKey" SecuritySchemeTypeHTTP SecuritySchemeType = "http" SecuritySchemeTypeMutualTLS SecuritySchemeType = "mutualTLS" SecuritySchemeTypeOAuth2 SecuritySchemeType = "oauth2" SecuritySchemeTypeOpenIDConnect SecuritySchemeType = "openIdConnect" )
type SecuritySchemes ¶ added in v0.0.14
type SecuritySchemes = Map[Ref[SecurityScheme]]
type Server ¶ added in v0.0.14
type Server struct {
URL string
Description string
Variables Map[ServerVariable]
}
func NewServers ¶ added in v0.0.14
type ServerVariable ¶ added in v0.0.14
func NewServerVariable ¶ added in v0.0.14
func NewServerVariable(sv *openapi3.ServerVariable) ServerVariable
type SourcerFunc ¶ added in v0.1.8
type Spec ¶
type Spec struct {
OpenAPI string
Info Info
Servers []Server
PathItems []*PathItem
Operations []*Operation
Components Components
Security []SecurityRequirement
}
Click to show internal directories.
Click to hide internal directories.