Add omitempty in event struct
This commit is contained in:
10
audit.go
10
audit.go
@@ -12,11 +12,11 @@ const (
|
|||||||
|
|
||||||
type AuditResult struct {
|
type AuditResult struct {
|
||||||
Op Op `bson:"op" json:"op"`
|
Op Op `bson:"op" json:"op"`
|
||||||
Entity string `bson:"entity" json:"entity"`
|
Entity string `bson:"entity,omitempty" json:"entity,omitempty"`
|
||||||
Data any `bson:"data" json:"data"`
|
Data any `bson:"data,omitempty" json:"data,omitempty",`
|
||||||
Before any `bson:"before" json:"before"`
|
Before any `bson:"before,omitempty" json:"before,omitempty"`
|
||||||
After any `bson:"after" json:"after"`
|
After any `bson:"after,omitempty" json:"after,omitempty"`
|
||||||
Context any `bson:"context" json:"context"`
|
Context any `bson:"context,omitempty" json:"context,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OnAudit func(audit *AuditResult) error
|
type OnAudit func(audit *AuditResult) error
|
||||||
Reference in New Issue
Block a user