Documentation
¶
Index ¶
Constants ¶
const (
ResponseMessageOk = "ok!"
)
constants
Variables ¶
This section is empty.
Functions ¶
func GetDurataionUsers ¶
func GetDurataionUsers(c echo.Context) error
GetDurataionUsers - Return users retrived with pkg/model/duration_data
Types ¶
type JwtCustomClaims ¶
type JwtCustomClaims struct { Name string `json:"name"` jwt.StandardClaims }
JwtCustomClaims - Define custom claims for token generation
type Response ¶
type Response interface { GetCode() int GetSuccess() bool GetMessage() string GetContent() echo.Map }
Response - Interface per generalizzare una response api/web
func FailedResponse ¶
FailedResponse - Restitusce una risposta failed
func NewResponse ¶
NewResponse - Restituisce una nuova response generica in base al context passato
func SuccessResponse ¶
func SuccessResponse(c echo.Context, content echo.Map) Response
SuccessResponse - Restituisce una risposta success
type ResponseAPI ¶
type ResponseAPI struct { Data ResponseData `json:"data"` Content echo.Map `json:"content,omitempty"` }
ResponseAPI - Define a standard struct response
func NewResponseAPI ¶
func NewResponseAPI(success bool, code int, message string, content echo.Map) ResponseAPI
NewResponseAPI - Restituisce una response
func (ResponseAPI) GetCode ¶
func (r ResponseAPI) GetCode() int
GetCode - Restituisce il codice della response api
func (ResponseAPI) GetContent ¶
func (r ResponseAPI) GetContent() echo.Map
GetContent - Restituisce l'eventuale content della response api
func (ResponseAPI) GetMessage ¶
func (r ResponseAPI) GetMessage() string
GetMessage - Restituisce il message della response api
func (ResponseAPI) GetSuccess ¶
func (r ResponseAPI) GetSuccess() bool
GetSuccess - Restituisce l'esito della response api
type ResponseData ¶
type ResponseData struct { Code int `json:"code"` Success bool `json:"success"` Message string `json:"message"` }
ResponseData - Definisce la struct della response.data