Documentation ¶
Index ¶
- Constants
- func AddValidatorLibs()
- func DeleteRedis(id string) (err error)
- func GetRedis(id string) (result string, err error)
- func GetRedisClient(redisHost, redisPort, redisPassword string, redisDb int) (*redis.Client, error)
- func JSONEncode(obj interface{}) string
- func JsonMinify(jsonB []byte) ([]byte, error)
- func LogAudittrailData(funcName, desc, source, commType string, key *[]string, ...)
- func LogAudittrailProcess(funcName, desc, info string, key *[]string)
- func LoggerError(err interface{})
- func ReadBody(c echo.Context, idem string) (map[string]interface{}, string, error)
- func StoreRedis(id string, data interface{}, duration time.Duration) (err error)
- func VerifCsrf(next echo.HandlerFunc) echo.HandlerFunc
- func VerifIdemKey(next echo.HandlerFunc) echo.HandlerFunc
- func VerifyMD5(idemKey string, request []byte) (string, error)
- type AuditTrialData
- type AuditTrialProcess
- type DataAudittrailProcess
- type Detail
- type Headers
- type MessagePayloadAudit
- type Request
- type RequestAndResponse
- type ResponseApi
- func (r *ResponseApi) Accepted(data interface{})
- func (r *ResponseApi) BadRequest(message string, err interface{})
- func (r *ResponseApi) InternalServerError(err error)
- func (r *ResponseApi) Out(code int, message, status string, data interface{})
- func (r *ResponseApi) Success(message string, data interface{})
- func (r *ResponseApi) Unauthorized(message string)
- type ResponseAudit
Constants ¶
View Source
const ( AUDITTRAIL_PROCESS = "audit-trial-process" AUDITTRAIL_DATA = "audit-trial-data" TIME_FORMAT = "2006-01-02 15:04:05" )
View Source
const ( Numeric string = "^-?[0-9]+$" Key string = "^[-a-zA-Z0-9_-]+$" )
Variables ¶
This section is empty.
Functions ¶
func AddValidatorLibs ¶
func AddValidatorLibs()
func DeleteRedis ¶
func GetRedisClient ¶ added in v2.0.2
func JSONEncode ¶
func JSONEncode(obj interface{}) string
func JsonMinify ¶
func LogAudittrailData ¶ added in v2.0.2
func LogAudittrailData(funcName, desc, source, commType string, key *[]string, data *RequestAndResponse)
add audittrail data
func LogAudittrailProcess ¶ added in v2.0.2
add audittrail process
func LoggerError ¶
func LoggerError(err interface{})
func VerifIdemKey ¶
func VerifIdemKey(next echo.HandlerFunc) echo.HandlerFunc
Types ¶
type AuditTrialData ¶ added in v2.0.2
type AuditTrialData struct { Subject string `json:"Subject,omitempty"` Function string `json:"Function,omitempty"` Description string `json:"Description,omitempty"` Key []string `json:"Key"` // Source string `json:"Source"` // internal or external CommunicationType string `json:"CommunicationType"` Data *RequestAndResponse `json:"Data"` }
type AuditTrialProcess ¶ added in v2.0.2
type AuditTrialProcess struct { Subject string `json:"Subject,omitempty"` Function string `json:"Function,omitempty"` Description string `json:"Description,omitempty"` Key []string `json:"Key"` Data DataAudittrailProcess `json:"Data"` }
type DataAudittrailProcess ¶ added in v2.0.3
type Headers ¶
type Headers struct { IdempotencyKey string `json:"idem_key"` Session string `json:"session"` Csrf string `json:"csrf"` }
func (*Headers) ValiadateHeaderCsrf ¶
func (h *Headers) ValiadateHeaderCsrf() interface{}
func (*Headers) ValiadateHeaderIdem ¶
func (h *Headers) ValiadateHeaderIdem() interface{}
type MessagePayloadAudit ¶ added in v2.0.2
type Request ¶ added in v2.0.2
type Request struct { Time string `json:"Time"` Path string `json:"Path,omitempty"` QueryString interface{} `json:"QueryString,omitempty"` Header interface{} `json:"Header,omitempty"` Param interface{} `json:"Param,omitempty"` Body interface{} `json:"Body,omitempty"` IpAddress string `json:"IpAddress,omitempty"` BrowserId int `json:"BrowserId,omitempty"` Latitude string `json:"Latitude,omitempty"` Longitude string `json:"Longitude,omitempty"` }
type RequestAndResponse ¶ added in v2.0.2
type RequestAndResponse struct { Request Request `json:"Request"` Response ResponseAudit `json:"Response"` }
type ResponseApi ¶
type ResponseApi struct { Code int `json:"code"` Status string `json:"status"` Message string `json:"message"` Data interface{} `json:"data,omitempty"` }
func (*ResponseApi) Accepted ¶
func (r *ResponseApi) Accepted(data interface{})
func (*ResponseApi) BadRequest ¶
func (r *ResponseApi) BadRequest(message string, err interface{})
BadRequest is method for bad request
func (*ResponseApi) InternalServerError ¶
func (r *ResponseApi) InternalServerError(err error)
InternalServerError is method for internal server error
func (*ResponseApi) Out ¶
func (r *ResponseApi) Out(code int, message, status string, data interface{})
func (*ResponseApi) Success ¶
func (r *ResponseApi) Success(message string, data interface{})
func (*ResponseApi) Unauthorized ¶
func (r *ResponseApi) Unauthorized(message string)
type ResponseAudit ¶ added in v2.0.2
Source Files ¶
Click to show internal directories.
Click to hide internal directories.