Documentation
¶
Index ¶
- func AddOperation(store *store.Store, item *v3.PathItem, method string, opt op.Option)
- func GetHandlers(p *Path) map[string]httpx.HandlerFunc
- func GetPathItem(p *Path, store *store.Store, item *v3.PathItem) *v3.PathItem
- type Option
- type Path
- func (p *Path) Handle(method string, opt op.Option, handler http.Handler)
- func (p *Path) HandleFunc(method string, opt op.Option, handler func(http.ResponseWriter, *http.Request))
- func (p *Path) Operation(method string, opt op.Option)
- func (p *Path) PathItem() func(*store.Store) *v3.PathItem
- func (p *Path) Route(method string, opt op.Option, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOperation ¶
AddOperation applies opt to item for the given HTTP method. An empty method registers the operation for all supported methods.
func GetHandlers ¶
func GetHandlers(p *Path) map[string]httpx.HandlerFunc
GetHandlers returns the registered handlers for each method on p. If no method is present the handler is registered for all supported methods.
Types ¶
type Option ¶
Option configures an OpenAPI path item.
func AdditionalOperation ¶
AdditionalOperation adds a named custom operation to the path item (OpenAPI 3.2+).
func Description ¶
Description sets the description for the path item.
func Parameter ¶
Parameter adds a shared parameter to the path item. in must be one of "path", "query", "header", or "cookie".
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
Path collects path item options, operations, and optional handlers for a single path.
func (*Path) HandleFunc ¶
func (p *Path) HandleFunc(method string, opt op.Option, handler func(http.ResponseWriter, *http.Request))
HandleFunc registers an OpenAPI operation and a handler func on the underlying mux.
func (*Path) Operation ¶
Operation registers an OpenAPI operation for the given method. If no method is present the operation is registered for all supported methods. Use this when the handler is registered separately.