Documentation ¶
Index ¶
- Variables
- func AuditServerUnaryInterceptor() grpc.UnaryServerInterceptor
- func DurationToDurationField(duration time.Duration) (key string, value interface{})
- func DurationToTimeMillisField(duration time.Duration) (key string, value interface{})
- func FuncErrorToCode(err error) codes.Code
- func Init(amqpConfig AMQPConfig, _fkConfig FKConfig, env string) error
- func JSONFormatter(payload string) string
- type AMQPConfig
- type Audit
- type DurationToField
- type ErrorToCode
- type FKConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var MQ_EXCHANGE_AUDIT_LOG = "audit.log.send.direct"
Functions ¶
func AuditServerUnaryInterceptor ¶
func AuditServerUnaryInterceptor() grpc.UnaryServerInterceptor
func DurationToDurationField ¶
DurationToDurationField uses the duration value to log the request duration.
func DurationToTimeMillisField ¶
DurationToTimeMillisField converts the duration to milliseconds and uses the key `grpc.time_ms`.
func FuncErrorToCode ¶
func JSONFormatter ¶
Types ¶
type AMQPConfig ¶
type Audit ¶
type Audit struct { LogType string `json:"logType"` Message message `json:"message"` DomainId int `json:"domainId"` SrcDomainId int `json:"srcDomainId"` ServiceName string `json:"serviceName"` SrcServiceName string `json:"srcServiceName"` ProjectId int `json:"projectId"` SrcProjectId int `json:"srcProjectId"` UserId int `json:"userId"` UserType int `json:"userType"` ObjectTypeId int `json:"objectTypeId"` Action string `json:"action"` OsEnv string `json:"osEnv"` }
type DurationToField ¶
var DefaultDurationToField DurationToField = DurationToTimeMillisField
DefaultDurationToField is the default implementation of converting request duration to a log field (key and value).
type ErrorToCode ¶
var DefaultErrorToCode ErrorToCode = FuncErrorToCode
Click to show internal directories.
Click to hide internal directories.