Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Actions Insert = "insert" Update = "update" Delete = "delete" // Timeout for cancel request DefaultTimeout = time.Second * 15 // Route paths PathLogEntry = "/v1/log" PathLogEntries = "/v1/bulk/log" )
Variables ¶
View Source
var ( ErrAuditEntryType = errors.New("must be AuditEntry or []AuditEntry type") ErrRespContent = errors.New("response shouldn't have any content") ErrStatus = errors.New("status must have 200") )
Errors
Functions ¶
func NewQueue ¶ added in v1.7.0
func NewQueue(clientHost, auditHost, auditHostAuthKey string, logEntry *logrus.Entry, workerThrottle ...time.Duration) *queue
NewQueue create instance of queue Example: queue := lxAudit.NewQueue(
"test-host", server.URL, "<auth key for host>", lxLog.GetLogger().WithFields(logrus.Fields{}), 10 * time.Millisecond)
optional workerThrottle is time.Sleep after job
Types ¶
type AuditEntries ¶ added in v1.7.0
type AuditEntries []AuditEntry
AuditEntries transport type for service
type AuditEntry ¶ added in v1.7.0
type AuditEntry struct { Host string `json:"host"` Collection string `json:"collection"` Action string `json:"action"` User interface{} `json:"user"` Data interface{} `json:"data"` }
AuditEntry transport type for service
Click to show internal directories.
Click to hide internal directories.