Documentation
¶
Index ¶
- type Client
- type Hook
- type Repository
- func (r *Repository) Activity() *models.ActivityModel
- func (r *Repository) Cache() *models.CacheModel
- func (r *Repository) Comment() *models.CommentModel
- func (r *Repository) Consent() *models.ConsentModel
- func (r *Repository) Group() *models.GroupModel
- func (r *Repository) GuildBan() *models.GuildBanModel
- func (r *Repository) Message() *models.MessageModel
- func (r *Repository) Reviewer() *models.ReviewerModel
- func (r *Repository) Setting() *models.SettingModel
- func (r *Repository) Stats() *models.StatsModel
- func (r *Repository) Sync() *models.SyncModel
- func (r *Repository) Tracking() *models.TrackingModel
- func (r *Repository) User() *models.UserModel
- func (r *Repository) View() *models.MaterializedViewModel
- type Service
- func (s *Service) Cache() *service.CacheService
- func (s *Service) Comment() *service.CommentService
- func (s *Service) Group() *service.GroupService
- func (s *Service) Reviewer() *service.ReviewerService
- func (s *Service) Stats() *service.StatsService
- func (s *Service) Sync() *service.SyncService
- func (s *Service) User() *service.UserService
- func (s *Service) View() *service.ViewService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
// Model returns the repository containing all model operations.
Model() *Repository
// Service returns the service containing all service operations.
Service() *Service
// Close gracefully shuts down the database connection.
Close() error
// DB returns the underlying bun.DB instance.
DB() *bun.DB
}
Client defines the methods that a database client must implement.
type Hook ¶
type Hook struct {
// contains filtered or unexported fields
}
Hook implements bun.QueryHook interface for logging queries with zap.
func (*Hook) AfterQuery ¶
func (h *Hook) AfterQuery(_ context.Context, event *bun.QueryEvent)
AfterQuery logs the query and its execution time.
func (*Hook) BeforeQuery ¶
BeforeQuery logs the query before execution.
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository provides access to all database models.
func NewRepository ¶
func NewRepository(db *bun.DB, logger *zap.Logger) *Repository
NewRepository creates a new repository instance with all models.
func (*Repository) Activity ¶
func (r *Repository) Activity() *models.ActivityModel
Activity returns the activities model repository.
func (*Repository) Cache ¶
func (r *Repository) Cache() *models.CacheModel
Cache returns the cache model repository.
func (*Repository) Comment ¶
func (r *Repository) Comment() *models.CommentModel
Comment returns the comment model repository.
func (*Repository) Consent ¶
func (r *Repository) Consent() *models.ConsentModel
Consent returns the consent model repository.
func (*Repository) Group ¶
func (r *Repository) Group() *models.GroupModel
Group returns the group model repository.
func (*Repository) GuildBan ¶
func (r *Repository) GuildBan() *models.GuildBanModel
GuildBan returns the guild ban model repository.
func (*Repository) Message ¶
func (r *Repository) Message() *models.MessageModel
Message returns the message model repository.
func (*Repository) Reviewer ¶
func (r *Repository) Reviewer() *models.ReviewerModel
Reviewer returns the reviewer model repository.
func (*Repository) Setting ¶
func (r *Repository) Setting() *models.SettingModel
Setting returns the setting model repository.
func (*Repository) Stats ¶
func (r *Repository) Stats() *models.StatsModel
Stats returns the stats model repository.
func (*Repository) Sync ¶
func (r *Repository) Sync() *models.SyncModel
Sync returns the sync model repository.
func (*Repository) Tracking ¶
func (r *Repository) Tracking() *models.TrackingModel
Tracking returns the tracking model repository.
func (*Repository) User ¶
func (r *Repository) User() *models.UserModel
User returns the user model repository.
func (*Repository) View ¶
func (r *Repository) View() *models.MaterializedViewModel
View returns the materialized view model repository.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides access to all business logic services.
func NewService ¶
NewService creates a new service instance with all services.
func (*Service) Cache ¶
func (s *Service) Cache() *service.CacheService
Cache returns the cache service.
func (*Service) Comment ¶
func (s *Service) Comment() *service.CommentService
Comment returns the comment service.
func (*Service) Group ¶
func (s *Service) Group() *service.GroupService
Group returns the group service.
func (*Service) Reviewer ¶
func (s *Service) Reviewer() *service.ReviewerService
Reviewer returns the reviewer service.
func (*Service) Stats ¶
func (s *Service) Stats() *service.StatsService
Stats returns the stats service.