Documentation ¶
Index ¶
- Variables
- func AttributeHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func FileHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func ListFilesHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func LogError(err error, context ...map[string]interface{}) bool
- func Login(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func NamespaceActionHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func NamespaceListHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func NewRouter(config *models.Config, db *gorm.DB) *mux.Router
- func Ping(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func Register(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func RouteHandler(requestType requestType, handlerData *web.HandlerData, inner RouteFunction, ...) http.Handler
- func UploadfileHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- func UserAttributeHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
- type AuthHandler
- type HTTPMethod
- type Route
- type RouteFunction
- type Routes
Constants ¶
This section is empty.
Variables ¶
var ( //ErrorTokenInvalid error if token is invalid ErrorTokenInvalid error = errors.New("Token invalid") //ErrorTokenEmpty error if token is empty ErrorTokenEmpty error = errors.New("Token empty") )
var AllowedSchemes = []string{"http", "https"}
AllowedSchemes schemes that are allowed in urls
var ( // ErrMissingFile error if file is missing ErrMissingFile = errors.New("missing upload file") )
Functions ¶
func AttributeHandler ¶
func AttributeHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
AttributeHandler handler for attributes
func FileHandler ¶
func FileHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
FileHandler handler for updating files
func ListFilesHandler ¶
func ListFilesHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
ListFilesHandler handler for listing files
func Login ¶
func Login(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
Login login handler -> /user/login
func NamespaceActionHandler ¶
func NamespaceActionHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
NamespaceActionHandler handler for namespace actions (create/update/delete)
func NamespaceListHandler ¶
func NamespaceListHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
NamespaceListHandler lists namespaces
func Ping ¶
func Ping(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
Ping handles ping request
func Register ¶
func Register(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
Register register handler -> /user/create
func RouteHandler ¶
func RouteHandler(requestType requestType, handlerData *web.HandlerData, inner RouteFunction, name string) http.Handler
RouteHandler logs stuff
func UploadfileHandler ¶
func UploadfileHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
UploadfileHandler handler for uploading files
func UserAttributeHandler ¶ added in v1.1.0
func UserAttributeHandler(handlerData web.HandlerData, w http.ResponseWriter, r *http.Request)
UserAttributeHandler handler for getting user attribute informations
Types ¶
type AuthHandler ¶
AuthHandler handler for http auth
func NewAuthHandler ¶
func NewAuthHandler(request *http.Request) *AuthHandler
NewAuthHandler returns a new AuthHandler
func (AuthHandler) GetBearer ¶
func (authHandler AuthHandler) GetBearer() string
GetBearer return the bearer token
func (AuthHandler) IsInvalid ¶
func (authHandler AuthHandler) IsInvalid(err error) bool
IsInvalid return true if err is invalid
type HTTPMethod ¶
type HTTPMethod string
HTTPMethod http method. GET, POST, DELETE, HEADER, etc...
const ( GetMethod HTTPMethod = "GET" POSTMethod HTTPMethod = "POST" PUTMethod HTTPMethod = "PUT" DeleteMethod HTTPMethod = "DELETE" )
HTTP methods
type Route ¶
type Route struct { Name string Method HTTPMethod Pattern string HandlerFunc RouteFunction HandlerType requestType }
Route for REST
type RouteFunction ¶
type RouteFunction func(web.HandlerData, http.ResponseWriter, *http.Request)
RouteFunction function for handling a route