audit_logs

package
v0.0.0-...-f2fa0db Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2021 License: MIT Imports: 19 Imported by: 0

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 API

type API interface {
	grpcgw.Controller
}

func New

func New(srv Service) API

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL