Documentation
¶
Index ¶
- Variables
- func IsValidationError(err error) bool
- type AuditService
- func (s *AuditService) CreateAuditLog(ctx context.Context, req *v1models.CreateAuditLogRequest) (*v1models.AuditLog, error)
- func (s *AuditService) GetAuditLogs(ctx context.Context, traceID *string, eventType *string, limit, offset int) ([]v1models.AuditLog, int64, error)
- func (s *AuditService) GetAuditLogsByTraceID(ctx context.Context, traceID string) ([]v1models.AuditLog, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidInput = errors.New("invalid input")
ErrInvalidInput represents an input validation error
View Source
var ErrValidation = errors.New("validation error")
ErrValidation represents a validation error in the domain layer This is a domain-specific error that abstracts away database implementation details
Functions ¶
func IsValidationError ¶
IsValidationError checks if an error is a validation error or invalid input
Types ¶
type AuditService ¶
type AuditService struct {
// contains filtered or unexported fields
}
AuditService handles generalized audit log operations
func NewAuditService ¶
func NewAuditService(repo database.AuditRepository) *AuditService
NewAuditService creates a new audit service instance using the database repository
func (*AuditService) CreateAuditLog ¶
func (s *AuditService) CreateAuditLog(ctx context.Context, req *v1models.CreateAuditLogRequest) (*v1models.AuditLog, error)
CreateAuditLog creates a new audit log entry from a request
func (*AuditService) GetAuditLogs ¶
func (s *AuditService) GetAuditLogs(ctx context.Context, traceID *string, eventType *string, limit, offset int) ([]v1models.AuditLog, int64, error)
GetAuditLogs retrieves audit logs with optional filtering
func (*AuditService) GetAuditLogsByTraceID ¶
func (s *AuditService) GetAuditLogsByTraceID(ctx context.Context, traceID string) ([]v1models.AuditLog, error)
GetAuditLogsByTraceID retrieves audit logs by trace ID (convenience method)
Click to show internal directories.
Click to hide internal directories.