Documentation ¶
Index ¶
- Constants
- Variables
- func GetApps(c *gin.Context, s *service.Service)
- func GetDebugLog(c *gin.Context, s *service.Service)
- func GetHighprilog(c *gin.Context, s *service.Service)
- func GetSet(c *gin.Context, s *service.Service)
- func GetUnusualIPs(c *gin.Context, s *service.Service)
- func ShowActivityLog(c *gin.Context, s *service.Service)
- func ShowDataChange(c *gin.Context, s *service.Service)
- type DataChangeReq
- type DebugLogRequest
- type GetSetReq
- type GetUnusualIPResponse
- type GetUnusualIpParam
- type HighPriReq
- type LogRequest
- type LogResponse
Constants ¶
View Source
const ( INVALID_PRIORITY = "invalid_priority" D = "D" C = "C" A = "A" )
View Source
const ( MsgId_InternalErr = 1001 MsgId_Invalid_Request = 1006 )
View Source
const ( ErrCode_Internal = "internal_err" ErrCode_InvalidRequest = "invalid_request" ErrCode_InvalidJson = "invalid_json" ErrCode_DatabaseError = "database_error" App = "app" )
Variables ¶
View Source
var (
APP, PRI, DAYS, SEARCHAFTERTIMESTAMP, SEARCHAFTERDOCID, CLASS, INSTANCE string = "App", "Pri", "Days", "SearchAfterTimestamp", "SearchAfterDocId", "Class", "Instance"
Priority = []string{"Debug2", "Debug1", "Debug0", "Info", "Warn", "Err", "Crit", "Sec"}
)
View Source
var (
DebugPriority = []string{"Debug2", "Debug1", "Debug0", "Info", "Warn", "Err", "Crit", "Sec"}
)
View Source
var LogType = logharbour.Activity
Functions ¶
func GetHighprilog ¶
GetHighprilog : handler for POST: "/highprilog" API
Types ¶
type DataChangeReq ¶
type DataChangeReq struct { App string `json:"app" validate:"required,alpha,lt=15"` Who *string `json:"who"` Class *string `json:"class"` Instance *string `json:"instance"` Field *string `json:"field"` Days *int `json:"days" validate:"omitempty,gt=0,lt=1003"` SearchAfterTimestamp *string `json:"search_after_timestamp" validate:"omitempty,datetime=2006-01-02T15:04:05Z"` SearchAfterDocId *string `json:"search_after_doc_id,omitempty"` }
DataChangeReq: is for request of ShowDataChange()
type DebugLogRequest ¶
type DebugLogRequest struct { App string `json:"app" validate:"required,alpha,lt=25"` Module string `json:"module" validate:"required,alpha"` Priority logharbour.LogPriority `json:"pri" validate:"required"` Days int `json:"days" validate:"required,number"` TraceID *string `json:"trace_id" validate:"omitempty"` SearchAfterTimestamp *string `json:"search_after_timestamp,omitempty"` SearchAfterDocId *string `json:"search_after_doc_id,omitempty"` }
request format
type GetSetReq ¶
type GetSetReq struct { App string `json:"app" validate:"required,alpha,lt=50"` SetAttr string `json:"setAttr" validate:"required,alpha,lt=50"` Type *logharbour.LogType `json:"type" validate:"omitempty,oneof=1 2 3 4"` Who *string `json:"who" validate:"omitempty,alpha,lt=20"` Class *string `json:"class" validate:"omitempty,alpha,lt=30"` Instance *string `json:"instance" validate:"omitempty,alpha,lt=30"` Op *string `json:"op" validate:"omitempty,alpha,lt=25"` Fromts *time.Time `json:"fromts" validate:"omitempty"` Tots *time.Time `json:"tots" validate:"omitempty"` Ndays *int `json:"ndays" validate:"omitempty,number,lt=100"` RemoteIP *string `json:"remoteIP" validate:"omitempty"` Pri *logharbour.LogPriority `json:"pri" validate:"omitempty,oneof=1 2 3 4 5 6 7 8"` }
type GetUnusualIPResponse ¶ added in v0.18.0
type GetUnusualIPResponse struct {
UnusualIPs []logharbour.IPLocation `json:"unusualIPs" validate:"required"`
}
type GetUnusualIpParam ¶
type HighPriReq ¶
type HighPriReq struct { App string `json:"app" validate:"required,alpha,lt=15"` Pri logharbour.LogPriority `json:"pri" validate:"required,lt=15"` // Pri logharbour.LogPriority `json:"pri" validate:"required, oneof=Info Debug2 Debug1 Debug0 Warn Err Crit Sec"` Days int `json:"days" validate:"required,gt=0,lt=1003"` SearchAfterTimestamp *string `json:"search_after_timestamp" validate:"omitempty,datetime=2006-01-02T15:04:05Z"` SearchAfterDocId *string `json:"search_after_doc_id,omitempty"` }
HighPriReq: is for request of GetHighprilog()
type LogRequest ¶
type LogRequest struct { App string `json:"app" validate:"required,alpha,lt=15"` Who *string `json:"who" validate:"omitempty,alpha,lt=15"` Class *string `json:"class" validate:"omitempty,alpha,lt=15"` InstanceID *string `json:"instance_id" validate:"omitempty,alphanum,lt=15"` Op *string `json:"op" validate:"omitempty,alpha,lt=15"` Priority *logharbour.LogPriority `json:"priority" validate:"omitempty,lt=15"` Days int `json:"days" validate:"required,number,lt=500"` // FromTS *string `json:"fromTs" validate:"omitempty,alpha,lt=15"` // ToTS *string `json:"toTs" validate:"omitempty,alpha,lt=15"` SearchAfterTimestamp *string `json:"search_after_timestamp" validate:"omitempty"` SearchAfterDocID *string `json:"search_after_doc_id" validate:"omitempty"` }
type LogResponse ¶
type LogResponse struct { LogEntery []logharbour.LogEntry Nrec int }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.