Documentation ¶
Index ¶
- Constants
- func AddSwaggerOperation(swagger *spec.Swagger, route *Route, builder *openapi.Builder)
- func NewRedocUI(specPath string) []byte
- func NewSwaggerUI(specPath string) []byte
- func NewUsernameContext(ctx context.Context, username string) context.Context
- func UsernameFromContext(ctx context.Context) string
- type API
- func (m *API) APIDoc(completer func(swagger *spec.Swagger)) *API
- func (m *API) BuildHandler() http.Handler
- func (m *API) Filter(pattern string, filters ...Filter) *API
- func (m *API) HealthCheck(checkfun func() error) *API
- func (m *API) Register(prefix string, modules ...Module) *API
- func (m *API) Route(route *Route) *API
- func (m *API) Serve(ctx context.Context, listenaddr string) error
- func (m *API) TLS(cert, key string) *API
- func (m *API) Version(data any) *API
- type Filter
- type Filters
- type Function
- type Group
- type Module
- type OIDCClientOptions
- type Param
- type ParamKind
- type PatternFilter
- type PatternFilters
- type ResponseMeta
- type Route
- func (n *Route) Accept(mime ...string) *Route
- func (n *Route) ContentType(mime ...string) *Route
- func (n *Route) Doc(summary string) *Route
- func (n *Route) Parameters(params ...Param) *Route
- func (n *Route) Response(body interface{}, desc ...string) *Route
- func (n *Route) SetProperty(k string, v interface{}) *Route
- func (n *Route) Tag(tags ...string) *Route
- func (n *Route) To(fun Function) *Route
- type StatusResponseWriter
Constants ¶
View Source
const ( RedocTemplate = `` /* 622-byte string literal not displayed */ SwaggerTemplate = `` /* 1427-byte string literal not displayed */ )
Variables ¶
This section is empty.
Functions ¶
func AddSwaggerOperation ¶
func NewRedocUI ¶
func NewSwaggerUI ¶
func NewUsernameContext ¶
func UsernameFromContext ¶
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func (*API) BuildHandler ¶
func (*API) HealthCheck ¶
type Filter ¶
func CORSFilter ¶
func CORSFilter() Filter
func LoggingFilter ¶
func OIDCAuthFilter ¶
func OIDCAuthFilter(ctx context.Context, opts *OIDCClientOptions) Filter
type Function ¶
type Function = http.HandlerFunc
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) AddSubGroup ¶
func (*Group) Parameters ¶
type OIDCClientOptions ¶
type Param ¶
type Param struct { Name string Kind ParamKind Type string Enum []any Default any IsOptional bool Description string Example any }
func BodyParameter ¶
func FormParameter ¶
func PathParameter ¶
func QueryParameter ¶
type PatternFilter ¶
type PatternFilters ¶
type PatternFilters []PatternFilter
func (PatternFilters) Process ¶
func (p PatternFilters) Process(w http.ResponseWriter, r *http.Request, next http.Handler)
type ResponseMeta ¶
type Route ¶
type Route struct { Summary string Path string Method string Deprecated bool Func Function Tags []string Consumes []string Produces []string Params []Param Responses []ResponseMeta Properties map[string]interface{} }
func (*Route) ContentType ¶
ContentType of all available responses type
func (*Route) Parameters ¶
func (*Route) SetProperty ¶
type StatusResponseWriter ¶
type StatusResponseWriter struct { http.ResponseWriter StatusCode int }
func (*StatusResponseWriter) WriteHeader ¶
func (w *StatusResponseWriter) WriteHeader(code int)
Click to show internal directories.
Click to hide internal directories.