Documentation
¶
Index ¶
- Constants
- func AddDefaultEndpoints()
- func DELETE(relativePath string, handler gin.HandlerFunc)
- func GET(relativePath string, handler gin.HandlerFunc)
- func GetRequiredScopes(c *gin.Context) string
- func Group(relativePath string) *gin.RouterGroup
- func HEAD(relativePath string, handler gin.HandlerFunc)
- func NullEndpoint(c *gin.Context)
- func OPTIONS(relativePath string, handler gin.HandlerFunc)
- func PATCH(relativePath string, handler gin.HandlerFunc)
- func POST(relativePath string, handler gin.HandlerFunc)
- func PUT(relativePath string, handler gin.HandlerFunc)
- func RobotsEndpoint(c *gin.Context)
- func ServeStaticAssets(path, dir string)
- func StandardAPIResponse(c *gin.Context, err error)
- func StandardJSONResponse(c *gin.Context, res interface{}, err error)
- func StandardNoRouteResponse(c *gin.Context)
- func StandardNotAuthorizedResponse(c *gin.Context)
- func Start()
- func Use(handler gin.HandlerFunc)
- type APIService
- type SecureRouterGroup
- func (srg *SecureRouterGroup) DELETE(relativePath, scope string, handler gin.HandlerFunc)
- func (srg *SecureRouterGroup) GET(relativePath, scope string, handler gin.HandlerFunc)
- func (srg *SecureRouterGroup) HEAD(relativePath, scope string, handler gin.HandlerFunc)
- func (srg *SecureRouterGroup) OPTIONS(relativePath, scope string, handler gin.HandlerFunc)
- func (srg *SecureRouterGroup) PATCH(relativePath, scope string, handler gin.HandlerFunc)
- func (srg *SecureRouterGroup) POST(relativePath, scope string, handler gin.HandlerFunc)
- func (srg *SecureRouterGroup) PUT(relativePath, scope string, handler gin.HandlerFunc)
Constants ¶
const ( // NamespacePrefix is the common namespace prefix of API releated routes NamespacePrefix string = "/a/1" // CronNamespacePrefix is the namespace for all scheduler routes CronNamespacePrefix = "/_c/1" // WorkerNamespacePrefix is the namespace for all worker routes WorkerNamespacePrefix = "/_w/1" )
Variables ¶
This section is empty.
Functions ¶
func AddDefaultEndpoints ¶ added in v0.0.2
func AddDefaultEndpoints()
AddDefaultEndpoints adds a couple of simple handlers to the router
func DELETE ¶ added in v0.0.2
func DELETE(relativePath string, handler gin.HandlerFunc)
DELETE is a shortcut for router.Handle("DELETE", path, handle).
func GET ¶ added in v0.0.2
func GET(relativePath string, handler gin.HandlerFunc)
GET is a shortcut for router.Handle("GET", path, handle).
func GetRequiredScopes ¶ added in v0.0.2
GetRequiredScopes returns the required scopes/scopes for this request or an empty string if none are required
func Group ¶ added in v0.0.2
func Group(relativePath string) *gin.RouterGroup
Group creates a new router group
func HEAD ¶ added in v0.0.2
func HEAD(relativePath string, handler gin.HandlerFunc)
HEAD is a shortcut for router.Handle("HEAD", path, handle).
func OPTIONS ¶ added in v0.0.2
func OPTIONS(relativePath string, handler gin.HandlerFunc)
OPTIONS is a shortcut for router.Handle("OPTIONS", path, handle).
func PATCH ¶ added in v0.0.2
func PATCH(relativePath string, handler gin.HandlerFunc)
PATCH is a shortcut for router.Handle("PATCH", path, handle).
func POST ¶ added in v0.0.2
func POST(relativePath string, handler gin.HandlerFunc)
POST is a shortcut for router.Handle("POST", path, handle).
func PUT ¶ added in v0.0.2
func PUT(relativePath string, handler gin.HandlerFunc)
PUT is a shortcut for router.Handle("PUT", path, handle).
func ServeStaticAssets ¶ added in v0.0.2
func ServeStaticAssets(path, dir string)
ServeStaticAssets adds handlers to serve static assets
func StandardAPIResponse ¶
StandardAPIResponse is the default way to respond to API requests
func StandardJSONResponse ¶
StandardJSONResponse is the default way to respond to API requests
func StandardNoRouteResponse ¶ added in v0.0.2
StandardNoRouteResponse is the default response to unknown routes
func StandardNotAuthorizedResponse ¶ added in v0.11.1
StandardNotAuthorizedResponse is the default response to unknown routes
Types ¶
type APIService ¶
type APIService struct {
// contains filtered or unexported fields
}
APIService abstracts an API endpoint
type SecureRouterGroup ¶ added in v0.0.2
type SecureRouterGroup struct {
// contains filtered or unexported fields
}
SecureRouterGroup wraps a gin.RouterGroup and adds metadata for request authorization
func SecureGroup ¶ added in v0.0.2
func SecureGroup(relativePath string, secureHandler gin.HandlerFunc) *SecureRouterGroup
SecureGroup creates a new router group with a security handler
func (*SecureRouterGroup) DELETE ¶ added in v0.0.2
func (srg *SecureRouterGroup) DELETE(relativePath, scope string, handler gin.HandlerFunc)
DELETE is a shortcut for router.Handle("DELETE", path, handle).
func (*SecureRouterGroup) GET ¶ added in v0.0.2
func (srg *SecureRouterGroup) GET(relativePath, scope string, handler gin.HandlerFunc)
GET is a shortcut for router.Handle("GET", path, handle).
func (*SecureRouterGroup) HEAD ¶ added in v0.0.2
func (srg *SecureRouterGroup) HEAD(relativePath, scope string, handler gin.HandlerFunc)
HEAD is a shortcut for router.Handle("HEAD", path, handle).
func (*SecureRouterGroup) OPTIONS ¶ added in v0.0.2
func (srg *SecureRouterGroup) OPTIONS(relativePath, scope string, handler gin.HandlerFunc)
OPTIONS is a shortcut for router.Handle("OPTIONS", path, handle).
func (*SecureRouterGroup) PATCH ¶ added in v0.0.2
func (srg *SecureRouterGroup) PATCH(relativePath, scope string, handler gin.HandlerFunc)
PATCH is a shortcut for router.Handle("PATCH", path, handle).
func (*SecureRouterGroup) POST ¶ added in v0.0.2
func (srg *SecureRouterGroup) POST(relativePath, scope string, handler gin.HandlerFunc)
POST is a shortcut for router.Handle("POST", path, handle).
func (*SecureRouterGroup) PUT ¶ added in v0.0.2
func (srg *SecureRouterGroup) PUT(relativePath, scope string, handler gin.HandlerFunc)
PUT is a shortcut for router.Handle("PUT", path, handle).