Documentation ¶
Index ¶
- func GenerateRandomBytes(n int) ([]byte, error)
- func GenerateRandomString(n int) (string, error)
- func WithFormRequestParser(ctx context.Context, r *http.Request, i interface{}) error
- func WithJsonRequestParser(ctx context.Context, r *http.Request, i interface{}) error
- func WithJsonResponseWriter(ctx context.Context, w http.ResponseWriter, i interface{}) error
- func WithRequestQueryParser(ctx context.Context, r *http.Request, i interface{}) error
- func WithRequestValidation(ctx context.Context, i interface{}) error
- func WithResponseValidation(ctx context.Context, i interface{}) error
- func WithResponseWriter(ctx context.Context, w http.ResponseWriter, tp string, i interface{}) error
- func WithYamlResponseWriter(ctx context.Context, w http.ResponseWriter, i interface{}) error
- type Endpoint
- type EndpointHandler
- type EndpointOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func GenerateRandomString ¶
GenerateRandomString returns a securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func WithFormRequestParser ¶
func WithJsonRequestParser ¶
func WithJsonResponseWriter ¶
func WithJsonResponseWriter(ctx context.Context, w http.ResponseWriter, i interface{}) error
func WithRequestQueryParser ¶
func WithRequestValidation ¶
func WithResponseValidation ¶
func WithResponseWriter ¶
func WithYamlResponseWriter ¶
func WithYamlResponseWriter(ctx context.Context, w http.ResponseWriter, i interface{}) error
Types ¶
type Endpoint ¶
type Endpoint struct { EndpointHandler // contains filtered or unexported fields }
func (Endpoint) Middleware ¶
func (ep Endpoint) Middleware() []middleware.MiddlewareHandler
func (*Endpoint) Setup ¶
func (ep *Endpoint) Setup(options ...EndpointOption)
func (Endpoint) Specification ¶
type EndpointHandler ¶
type EndpointHandler interface { http.Handler Specification() api.Path Middleware() []middleware.MiddlewareHandler }
type EndpointOption ¶
type EndpointOption func(e *Endpoint)
func WithMiddleware ¶
func WithMiddleware(handlers ...middleware.MiddlewareHandler) EndpointOption
func WithSpecification ¶
func WithSpecification(spec api.Path) EndpointOption
Click to show internal directories.
Click to hide internal directories.