Documentation ¶
Index ¶
- Constants
- func Delete(path string) endpointPath
- func Echo[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, next Endpoint[C, P, Q, B, D]) (string, string, echo.HandlerFunc)
- func EchoWithContext[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, ...) (string, string, echo.HandlerFunc)
- func EchoWithNoResponse[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, ...) (string, string, echo.HandlerFunc)
- func Fiber[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, next Endpoint[C, P, Q, B, D]) (string, string, fiber.Handler)
- func Find[T comparable](a []T, x T) (T, bool)
- func Get(path string) endpointPath
- func Gorilla[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, next Endpoint[C, P, Q, B, D]) (string, string, http.HandlerFunc)
- func Patch(path string) endpointPath
- func Post(path string) endpointPath
- func Put(path string) endpointPath
- func WithEchoResponseSkipper(s EchoSkipper) echoOptions
- func WithRestoredBody() echoOptions
- type CollectionDetail
- type CollectionItemData
- type DataDetail
- type DataResponse
- type EchoSkipper
- type Endpoint
- type EndpointInput
- type EndpointWithContext
- type OpenAPI
- func (op *OpenAPI) AddJWTBearerAuth(name string) *openapi3.T
- func (op *OpenAPI) AddServer(url, description string) *openapi3.T
- func (op *OpenAPI) Describe(description string)
- func (op *OpenAPI) Route(title, description string) OpenAPIRouteDescriber
- func (op *OpenAPI) RouteGroup(name string, description ...string) OpenAPIRouteGroup
- func (op *OpenAPI) T() *openapi3.T
- type OpenAPIRouteDescriber
- type OpenAPIRouteGroup
- type RouteDescription
- type SchemaRepo
- type Schemaer
- type SingleItemData
Constants ¶
View Source
const ( GET httpVerb = "GET" POST httpVerb = "POST" PUT httpVerb = "PUT" PATCH httpVerb = "PATCH" DELETE httpVerb = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
func Echo ¶
func Echo[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, next Endpoint[C, P, Q, B, D]) (string, string, echo.HandlerFunc)
func EchoWithContext ¶
func EchoWithContext[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, next EndpointWithContext[C, P, Q, B, D, echo.Context], opts ...echoOptions) (string, string, echo.HandlerFunc)
func EchoWithNoResponse ¶
func EchoWithNoResponse[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, next EndpointWithContext[C, P, Q, B, D, echo.Context], opts ...echoOptions) (string, string, echo.HandlerFunc)
func Fiber ¶
func Fiber[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, next Endpoint[C, P, Q, B, D]) (string, string, fiber.Handler)
func Find ¶
func Find[T comparable](a []T, x T) (T, bool)
func Gorilla ¶
func Gorilla[C, P, Q, B any, D dataer](p endpointPath, d OpenAPIRouteDescriber, next Endpoint[C, P, Q, B, D]) (string, string, http.HandlerFunc)
func WithEchoResponseSkipper ¶
func WithEchoResponseSkipper(s EchoSkipper) echoOptions
func WithRestoredBody ¶
func WithRestoredBody() echoOptions
Types ¶
type CollectionDetail ¶
type CollectionDetail struct { // The number of items in this result set CurrentItemCount int64 `json:"currentItemCount" example:"1"` // The number of items in the result ItemsPerPage int64 `json:"itemsPerPage" example:"10"` // The index of the first item in data.items StartIndex int64 `json:"startIndex" example:"1"` // The total number of items available in this set TotalItems int64 `json:"totalItems" example:"100"` // The index of the current page of items PageIndex int64 `json:"pageIndex" example:"1"` // The total number of pages in the result set. TotalPages int64 `json:"totalPages" example:"10"` }
type CollectionItemData ¶
type CollectionItemData[T any] struct { DataDetail Items []T `json:"items"` CollectionDetail }
type DataDetail ¶
type DataDetail struct { // The kind property serves as a guide to what type of information this particular object stores Kind string `json:"kind" example:"resource"` // Indicates the language of the rest of the properties in this object (BCP 47) Language string `json:"lang,omitempty" example:"pt-br"` }
type DataResponse ¶
type DataResponse[T dataer] struct { // Client sets this value and server echos data in the response Context string `json:"context,omitempty"` Data T `json:"data"` }
type EchoSkipper ¶
type EchoSkipper func(c echo.Context) bool
type Endpoint ¶
type Endpoint[C, P, Q, B any, D dataer] func(EndpointInput[C, P, Q, B]) (DataResponse[D], error)
type EndpointInput ¶
type EndpointInput[C, P, Q, B any] struct { Claims C Params P Query Q Body B }
type EndpointWithContext ¶
type EndpointWithContext[C, P, Q, B any, D dataer, Context any] func(EndpointInput[C, P, Q, B], Context) (DataResponse[D], error)
type OpenAPI ¶
type OpenAPI struct {
// contains filtered or unexported fields
}
func NewOpenAPI ¶
func (*OpenAPI) Route ¶
func (op *OpenAPI) Route(title, description string) OpenAPIRouteDescriber
func (*OpenAPI) RouteGroup ¶
func (op *OpenAPI) RouteGroup(name string, description ...string) OpenAPIRouteGroup
type OpenAPIRouteDescriber ¶
type OpenAPIRouteDescriber func(func(RouteDescription, *openapi3.T))
type OpenAPIRouteGroup ¶
type OpenAPIRouteGroup struct {
// contains filtered or unexported fields
}
func (*OpenAPIRouteGroup) Route ¶
func (g *OpenAPIRouteGroup) Route(title, description string) OpenAPIRouteDescriber
type RouteDescription ¶
type SchemaRepo ¶
type Schemaer ¶
type Schemaer interface {
Schema() SchemaRepo
}
type SingleItemData ¶
type SingleItemData[T any] struct { DataDetail Item T `json:"item"` }
Click to show internal directories.
Click to hide internal directories.