Documentation ¶
Index ¶
Constants ¶
const (
)Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API is the root API structure.
func (*API) RegisterRoute ¶
func (a *API) RegisterRoute(method string, p string, handler http.HandlerFunc)
RegisterRoute registers a new handler at the given path.
type DebugHandler ¶
type DebugHandler struct{}
DebugHandler exposes debug routes.
func (DebugHandler) Append ¶
func (g DebugHandler) Append(router *mux.Router)
Append adds debug routes to the specified router.
type IPFilter ¶
type IPFilter struct {
// contains filtered or unexported fields
}
IPFilter implements a simple IP filter. It is configured with an access control list containing IP and CIDR addresses that are allowed to access the specified resource. If the list of allowed addresses is empty, any request is granted access and bypasses the filter without any restrictions.
func NewIPFilter ¶
NewIPFilter creates a new IP filter.
func (*IPFilter) Wrap ¶
func (f *IPFilter) Wrap(next http.HandlerFunc) http.HandlerFunc
Wrap wraps the specified handler with an IP filter. It filters the request based on the configured access control list and allows or blocks the request according to the original IP. If the list of allowed IPs is empty, any request bypasses the filter.
type VersionHandler ¶
type VersionHandler struct{}
VersionHandler exposes version routes.
func (VersionHandler) Append ¶
func (v VersionHandler) Append(router *mux.Router)
Append adds version routes to the specified router.