Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockRepository ¶
func NewMockRepository() *mockRepository
func ValidateCreateRequest ¶
func ValidateCreateRequest(c *auth.CreateAuditLogRequest) error
ValidateCreateRequest validates the CreateAuditLogRequest fields.
Types ¶
type Repository ¶
type Repository interface { // Get returns the auditLog with the specified auditLog UUID. Get(ctx context.Context, uuid string) (entity.AuditLog, error) // Count returns the number of auditLogs. Count(ctx context.Context) (int64, error) // Query returns the list of auditLogs with the given offset and limit. Query(ctx context.Context, query string, offset, limit int64) ([]entity.AuditLog, int, error) // Create saves a new auditLogs in the storage. Create(ctx context.Context, auditLog entity.AuditLog) (string, error) }
Repository encapsulates the logic to access audit logs from the data source.
func NewRepository ¶
func NewRepository(db *db.DB) Repository
NewRepository creates a new audit log repository
type Service ¶
type Service interface { Get(ctx context.Context, uuid string) (*auth.AuditLog, error) Query(ctx context.Context, query string, offset, limit int64) (*auth.ListAuditLogsResponse, error) Count(ctx context.Context) (int64, error) Create(ctx context.Context, input *auth.CreateAuditLogRequest) (*auth.AuditLog, error) }
Service encapsulates use case logic for audit logs.
func NewService ¶
func NewService(repo Repository, userRepo users.Repository) Service
NewService creates a new audit logs service.
Click to show internal directories.
Click to hide internal directories.