Documentation
¶
Index ¶
- func Connect(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Delete(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Get(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Head(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Options(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Patch(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Post(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Put(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Register(r chi.Router, method, path string, handler http.Handler, meta Meta)
- func Trace(r chi.Router, path string, handler http.HandlerFunc, meta Meta)
- func Wrap(handler http.Handler, meta Meta) http.Handler
- type Mapping
- type Meta
- type MetaHandler
- type Permission
- type RouteInfo
- type Scope
- type Snapshot
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Meta ¶
Meta holds permission codes and route metadata for a handler.
func ExtractMeta ¶
ExtractMeta returns metadata from a handler if present.
type MetaHandler ¶
type MetaHandler struct {
Meta Meta
// contains filtered or unexported fields
}
MetaHandler wraps a handler with permission metadata.
func (*MetaHandler) ServeHTTP ¶
func (h *MetaHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type Permission ¶
Permission represents a permission code definition.
type RouteInfo ¶
type RouteInfo struct {
Method string
Path string
Description string
IsPublic bool
Permissions []string
}
RouteInfo represents API route metadata.
type Snapshot ¶
type Snapshot struct {
Permissions []Permission
Routes []RouteInfo
Mappings []Mapping
}
Snapshot contains all permissions, routes, and mappings for syncing.
func BuildSnapshot ¶
BuildSnapshot builds a deduplicated snapshot from routes.
Click to show internal directories.
Click to hide internal directories.