mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
Provide helpers to for adding API routes
This commit is contained in:
parent
8466cafe1f
commit
bc2cab5721
2 changed files with 114 additions and 104 deletions
|
@ -88,6 +88,16 @@ func Add(rt *env.Runtime, prefix, path string, methods, queries []string, endPtF
|
|||
return nil
|
||||
}
|
||||
|
||||
// AddPrivate endpoint
|
||||
func AddPrivate(rt *env.Runtime, path string, methods, queries []string, endPtFn RouteFunc) error {
|
||||
return Add(rt, RoutePrefixPrivate, path, methods, queries, endPtFn)
|
||||
}
|
||||
|
||||
// AddPublic endpoint
|
||||
func AddPublic(rt *env.Runtime, path string, methods, queries []string, endPtFn RouteFunc) error {
|
||||
return Add(rt, RoutePrefixPublic, path, methods, queries, endPtFn)
|
||||
}
|
||||
|
||||
// Remove an endpoint.
|
||||
func Remove(rt *env.Runtime, prefix, path string, methods, queries []string) error {
|
||||
k, e := routesKey(rt, prefix, path, methods, queries)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue