Documentation ¶
Index ¶
- Variables
- func Bind(form interface{}, structs interface{}) interface{}
- func ClientIP(c echo.Context) string
- func DateNil(dt interface{}) interface{}
- func DateParse(d interface{}, format string) *time.Time
- func ErrorContext(message interface{}, c echo.Context) (err error)
- func InArray(val interface{}, arrays interface{}) bool
- func InitSentry(Dsn, Environment, Release string, Debug bool) *sentry.Client
- func JsonDecode(data interface{}) (maps map[string]interface{}, err error)
- func JsonEncode(data interface{}) string
- func JsonEncodeBeautify(data interface{}) string
- func LoggerDebug(msg interface{})
- func LoggerError(err error)
- func LoggerInfo(message interface{})
- func LoggerSuccess(message interface{})
- func LoggerWarning(message interface{})
- func NotFoundContext(message interface{}, data interface{}, c echo.Context) (err error)
- func RPCJSONResponse(status string, message interface{}, data interface{}) string
- func RandStringBytes(n int) string
- func ResponseContext(code int, message interface{}, data interface{}, c echo.Context) error
- func SendSentryError(err error, service, module, function string)
- func SendSentryEvent(event *sentry.Event, service, module, function string)
- func SendSentryMessage(message string, service, module, function string)
- func Success(message string, data interface{}, c echo.Context) map[string]interface{}
- func SuccessContext(message interface{}, data interface{}, c echo.Context) (err error)
- func TimeoutContext(message interface{}, c echo.Context) (err error)
- func UUID() string
- func V2ErrorContext(message interface{}, c echo.Context) (err error)
- func V2NotFoundContext(message interface{}, data interface{}, c echo.Context) (err error)
- func V2RPCJSONResponse(status string, message interface{}, data interface{}) string
- func V2ResponseContext(code int, message interface{}, data interface{}, c echo.Context) error
- func V2Success(message string, data interface{}, c echo.Context) map[string]interface{}
- func V2SuccessContext(message interface{}, data interface{}, c echo.Context) (err error)
- func V2TimeoutContext(message interface{}, c echo.Context) (err error)
- func V2ValidationContext(message interface{}, data interface{}, c echo.Context) (err error)
- func V2ValidationResp(message interface{}, data interface{}) map[string]interface{}
- func Validate(c echo.Context, i interface{}) (interface{}, error)
- func ValidateRPC(i interface{}) (interface{}, error)
- func ValidationContext(message interface{}, data interface{}, c echo.Context) (err error)
- func ValidationResp(message interface{}, data interface{}) map[string]interface{}
- type JSONResponse
- type Response
- type SentryData
- type V2JSONResponse
- type V2Response
Constants ¶
This section is empty.
Variables ¶
View Source
var SentryClient *sentry.Client
View Source
var Validates *validator.Validate
Functions ¶
func ErrorContext ¶
func ErrorContext(message interface{}, c echo.Context) (err error)
func InitSentry ¶ added in v1.2.0
func JsonDecode ¶
func JsonEncode ¶
func JsonEncode(data interface{}) string
func JsonEncodeBeautify ¶ added in v1.0.2
func JsonEncodeBeautify(data interface{}) string
func NotFoundContext ¶
func NotFoundContext(message interface{}, data interface{}, c echo.Context) (err error)
func RPCJSONResponse ¶
func RandStringBytes ¶
func ResponseContext ¶
func SendSentryError ¶ added in v1.2.0
func SendSentryEvent ¶ added in v1.2.0
func SendSentryEvent(event *sentry.Event, service, module, function string)
func SendSentryMessage ¶ added in v1.2.0
func SuccessContext ¶
func SuccessContext(message interface{}, data interface{}, c echo.Context) (err error)
V1 Version 1 snake_case
func TimeoutContext ¶
func TimeoutContext(message interface{}, c echo.Context) (err error)
func V2ErrorContext ¶ added in v1.1.0
func V2ErrorContext(message interface{}, c echo.Context) (err error)
func V2NotFoundContext ¶ added in v1.1.0
func V2NotFoundContext(message interface{}, data interface{}, c echo.Context) (err error)
func V2RPCJSONResponse ¶ added in v1.1.0
func V2ResponseContext ¶ added in v1.1.0
func V2SuccessContext ¶ added in v1.1.0
func V2SuccessContext(message interface{}, data interface{}, c echo.Context) (err error)
V2 Version 2 CamlCase
func V2TimeoutContext ¶ added in v1.1.0
func V2TimeoutContext(message interface{}, c echo.Context) (err error)
func V2ValidationContext ¶ added in v1.1.0
func V2ValidationContext(message interface{}, data interface{}, c echo.Context) (err error)
func V2ValidationResp ¶ added in v1.1.0
func V2ValidationResp(message interface{}, data interface{}) map[string]interface{}
func ValidateRPC ¶
func ValidateRPC(i interface{}) (interface{}, error)
func ValidationContext ¶
func ValidationContext(message interface{}, data interface{}, c echo.Context) (err error)
func ValidationResp ¶
func ValidationResp(message interface{}, data interface{}) map[string]interface{}
Types ¶
type JSONResponse ¶
type JSONResponse struct { Code int `json:"status_code"` Status string `json:"status"` Message interface{} `json:"message"` Data interface{} `json:"data"` }
func (*JSONResponse) Error ¶
func (response *JSONResponse) Error(message interface{}, data interface{})
func (*JSONResponse) Success ¶
func (response *JSONResponse) Success(message interface{}, data interface{})
func (*JSONResponse) Validation ¶
func (response *JSONResponse) Validation(message interface{}, data interface{})
type Response ¶
type Response struct { Code int `json:"status_code"` Status string `json:"status"` Message interface{} `json:"message"` Data interface{} `json:"data"` }
type SentryData ¶ added in v1.2.0
type SentryData struct { Dsn string Environment string Release string Debug bool TraceSampleRate float64 Event *sentry.Event }
var Sentries *SentryData
func NewSentryData ¶ added in v1.2.0
func NewSentryData() *SentryData
type V2JSONResponse ¶ added in v1.1.0
type V2JSONResponse struct { Code int `json:"StatusCode"` Status string `json:"Status"` Message interface{} `json:"Message"` Data interface{} `json:"Data"` }
func (*V2JSONResponse) V2Error ¶ added in v1.1.0
func (response *V2JSONResponse) V2Error(message interface{}, data interface{})
func (*V2JSONResponse) V2Success ¶ added in v1.1.0
func (response *V2JSONResponse) V2Success(message interface{}, data interface{})
func (*V2JSONResponse) V2Validation ¶ added in v1.1.0
func (response *V2JSONResponse) V2Validation(message interface{}, data interface{})
type V2Response ¶ added in v1.1.0
type V2Response struct { Code int `json:"StatusCode"` Status string `json:"Status"` Message interface{} `json:"Message"` Data interface{} `json:"Data"` }
func (*V2Response) V2Error ¶ added in v1.1.0
func (response *V2Response) V2Error(code int, message string, data interface{})
func (*V2Response) V2Success ¶ added in v1.1.0
func (response *V2Response) V2Success(code int, message string, data interface{})
Click to show internal directories.
Click to hide internal directories.