Documentation ¶
Overview ¶
Package classification Snippets API
Documentation for Snippets API used for database manipulation
Schemes: https BasePath: / Version: 0.0.4 Contact: Vitor Graveto<vitor@wexcedo.com> Consumes: - application/json Produces: - application/json SecurityDefinitions: snippetskey: type: apiKey description: JSON Web Token (JWT) - token name: Authentication in: header
swagger:meta
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct { DebugOn bool ErrorLog *log.Logger InfoLog *log.Logger Snippets models.Snippets Users models.Users Tokens models.Tokens Val *models.Validation }
Define an application struct to hold the application-wide dependencies for the API application. This will allow us to make the objects available to our handlers.
func (*Application) Routes ¶
func (app *Application) Routes() http.Handler
func (*Application) ValidateJSONBody ¶
func (app *Application) ValidateJSONBody(dataObj, contextKey interface{}) func(next http.Handler) http.Handler
ValidateJSONBody provides JSON body read and validation middleware for handlers reads the JSON body to a given data object and validates its content adds that data to the request context when valid and calls the next handler otherwise aborts the request returning the response message with information
type KeyChangeUserPassword ¶
type KeyChangeUserPassword struct{}
KeyChangeUserPassword is a key used for ChangeUserPassword object in the context
type KeyCreateUser ¶
type KeyCreateUser struct{}
KeyCreateUser is a key used for CreateUser object in the context
type KeyLoginUser ¶
type KeyLoginUser struct{}
KeyLoginUser is a key used for the LoginUser object in the context
type KeySnippetCreate ¶
type KeySnippetCreate struct{}
KeySnippet is a key used for the Snippet object in the context
type KeyTokenUser ¶
type KeyTokenUser struct{}
KeyTokenUser is a key used for the TokenUser object in the context