Documentation
¶
Index ¶
- func Init(config LogComConfiguration, logger *zerolog.Logger)
- func IsEnabled() bool
- func SendAuditLog(ctx context.Context, model logcomapi.CreateAuditLogRequestDto) error
- func SendAuditLogGroup(ctx context.Context, auditLogCollector *AuditLogCollector) error
- func SendAuditLogWithCreation(ctx context.Context, subject, subjectName string, newValue interface{}) error
- func SendAuditLogWithDeletion(ctx context.Context, subject, subjectName string, oldValue interface{}) error
- func SendAuditLogWithModification(ctx context.Context, subject, subjectName string, ...) error
- func SendAuditLogWithModificationModelChanges(ctx context.Context, subject, subjectName string, changes []ModelChange) error
- func SendConsoleLog(ctx context.Context, logLevel zerolog.Level, message string) error
- func SendConsoleLogWithModel(ctx context.Context, model logcomapi.CreateConsoleLogRequestDto) error
- func SendNotification(ctx context.Context, eventCategory string, message string, ...) error
- func SendNotificationWithModel(ctx context.Context, model logcomapi.CreateNotificationRequestDto) error
- type AuditLogAction
- type AuditLogCollector
- func (c *AuditLogCollector) Add(model logcomapi.CreateAuditLogRequestDto)
- func (c *AuditLogCollector) AddCreation(itemSubject, itemSubjectName string, newValue interface{})
- func (c *AuditLogCollector) AddDeletion(itemSubject, itemSubjectName string, oldValue interface{})
- func (c *AuditLogCollector) AddModification(itemSubject, itemSubjectName string, oldValue, newValue interface{})
- type AuditLogInitializer
- type AuditLogModelDiff
- type AuditLogOperation
- type ConsoleLog
- type HeaderProviderFunc
- type LogComConfiguration
- type ModelChange
- type NotificationAction
- type NotificationConfigurer
- type NotificationInitializer
- type NotificationMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(config LogComConfiguration, logger *zerolog.Logger)
func SendAuditLog ¶
func SendAuditLogGroup ¶
func SendAuditLogGroup(ctx context.Context, auditLogCollector *AuditLogCollector) error
func SendAuditLogWithModificationModelChanges ¶
func SendAuditLogWithModificationModelChanges(ctx context.Context, subject, subjectName string, changes []ModelChange) error
func SendConsoleLog ¶
func SendConsoleLogWithModel ¶
func SendNotification ¶
Types ¶
type AuditLogAction ¶
type AuditLogAction interface { IgnoreChangeOf(propertyName string) AuditLogAction AndNotify() NotificationConfigurer[AuditLogAction] AndNotifyRoles(targets ...string) AuditLogAction AndNotifySessions(targets ...string) AuditLogAction AndNotifyUsers(targets ...string) AuditLogAction AndLog(logLevel zerolog.Level, message string) AuditLogAction Send() error }
type AuditLogCollector ¶
type AuditLogCollector struct {
// contains filtered or unexported fields
}
func NewAuditLogCollector ¶
func NewAuditLogCollector(parentSubject, parentSubjectName string) *AuditLogCollector
func NewAuditLogCollectorWithParent ¶
func NewAuditLogCollectorWithParent(parentAuditLog logcomapi.CreateAuditLogRequestDto) *AuditLogCollector
func (*AuditLogCollector) Add ¶
func (c *AuditLogCollector) Add(model logcomapi.CreateAuditLogRequestDto)
func (*AuditLogCollector) AddCreation ¶
func (c *AuditLogCollector) AddCreation(itemSubject, itemSubjectName string, newValue interface{})
func (*AuditLogCollector) AddDeletion ¶
func (c *AuditLogCollector) AddDeletion(itemSubject, itemSubjectName string, oldValue interface{})
func (*AuditLogCollector) AddModification ¶
func (c *AuditLogCollector) AddModification(itemSubject, itemSubjectName string, oldValue, newValue interface{})
type AuditLogInitializer ¶
type AuditLogInitializer interface { WithClientSecret(secret string) AuditLogAction WithBearerAuthorization(bearerToken string) AuditLogAction WithContext(ctx context.Context) AuditLogAction WithTransactionID(transactionID uuid.UUID) AuditLogInitializer }
func AuditCreation ¶
func AuditCreation(subject, subjectName string, newValue interface{}) AuditLogInitializer
func AuditDeletion ¶
func AuditDeletion(subject, subjectName string, oldValue interface{}) AuditLogInitializer
func AuditModification ¶
func AuditModification(subject, subjectName string, oldValue, newValue interface{}) AuditLogInitializer
type AuditLogModelDiff ¶
type AuditLogModelDiff interface {
GetChanges(model interface{}, ignoredProperties map[string]interface{}) []ModelChange
}
type AuditLogOperation ¶
type AuditLogOperation interface { Create(subject, subjectName string, newValue interface{}) AuditLogInitializer Delete(subject, subjectName string, oldValue interface{}) AuditLogInitializer Modify(subject, subjectName string, oldValue interface{}, newValue interface{}) AuditLogInitializer }
func Audit ¶
func Audit() AuditLogOperation
type ConsoleLog ¶
type ConsoleLog interface { }
type LogComConfiguration ¶
type LogComConfiguration struct { ServiceName string LogComURL string HeaderProvider HeaderProviderFunc }
type ModelChange ¶
type ModelChange struct { PropertyName string OldValue interface{} NewValue interface{} }
func GetModelChanges ¶
func GetModelChanges(ctx context.Context, oldModel, newModel interface{}, ignoredProperties ...string) ([]ModelChange, error)
type NotificationAction ¶
type NotificationAction interface { AndLog(logLevel zerolog.Level, message string) NotificationAction Send() error SendMessage(message string) error }
type NotificationConfigurer ¶
type NotificationConfigurer[T any] interface { Message(message string) T Roles(targets ...string) NotificationConfigurer[T] Sessions(targets ...string) NotificationConfigurer[T] Users(targets ...string) NotificationConfigurer[T] }
func Notify ¶
func Notify() NotificationConfigurer[NotificationAction]
type NotificationInitializer ¶
type NotificationInitializer interface { WithClientSecret(secret string) NotificationAction WithBearerAuthorization(bearerToken string) NotificationAction WithContext(ctx context.Context) NotificationAction WithTransactionID(transactionID uuid.UUID) NotificationInitializer }
type NotificationMessage ¶
Click to show internal directories.
Click to hide internal directories.