Documentation
¶
Overview ¶
Package api provides common api functionality
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authorizer ¶
type Authorizer interface {
// AuthBasic handles basic authentication
AuthBasic(user string, pass string) (interface{}, error)
// AuthToken handles simple token or api key authentication
AuthToken(token string) (interface{}, error)
// AuthOauth handles Oauth 2.0 token authorization
AuthOauth(token string, scopes []string) (interface{}, error)
}
Authorizer is an api authorization interface
type Controller ¶
type Controller interface {
// DB returns the application database instance
DB() *sql.DB
// Options returns the application config kvdb
Options() jsondb.DB
// Authorizer returns the application api authorizer
Authorizer() Authorizer
}
Controller provided basic functions to an api
Click to show internal directories.
Click to hide internal directories.