Documentation ¶
Index ¶
- type IRepository
- type IUseCase
- type SQLRepository
- func (r SQLRepository) CreateKarma(ctx context.Context, karma *domain.Karma) error
- func (r SQLRepository) GetKarmaByGuildID(ctx context.Context, guildID string) ([]domain.Karma, error)
- func (r SQLRepository) GetKarmaByUserIDAndGuildID(ctx context.Context, userID, guildID string) (domain.Karma, error)
- func (r SQLRepository) GetTopKarmaByGuildID(ctx context.Context, guildID string) ([]domain.Karma, error)
- func (r SQLRepository) UpdateKarma(ctx context.Context, karma *domain.Karma) error
- type UseCase
- func (u UseCase) CreateKarma(ctx context.Context, karma domain.Karma) (domain.Karma, error)
- func (u UseCase) GetKarma(ctx context.Context, userID, guildID string) (domain.Karma, error)
- func (u UseCase) GetTopKarma(ctx context.Context, guildID string) ([]domain.Karma, error)
- func (u UseCase) IncrementKarma(ctx context.Context, userID, guildID string) (domain.Karma, error)
- func (u UseCase) UpdateKarma(ctx context.Context, karma domain.Karma) (domain.Karma, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IRepository ¶
type IRepository interface { CreateKarma(ctx context.Context, karma *domain.Karma) error UpdateKarma(ctx context.Context, karma *domain.Karma) error GetKarmaByGuildID(ctx context.Context, guildID string) ([]domain.Karma, error) GetKarmaByUserIDAndGuildID(ctx context.Context, userID, guildID string) (domain.Karma, error) GetTopKarmaByGuildID(ctx context.Context, guildID string) ([]domain.Karma, error) }
IRepository is the user repository interface.
func NewSQLRepository ¶
func NewSQLRepository(dbConn *gorm.DB) IRepository
type IUseCase ¶
type IUseCase interface { CreateKarma(ctx context.Context, karma domain.Karma) (domain.Karma, error) UpdateKarma(ctx context.Context, karma domain.Karma) (domain.Karma, error) GetKarma(ctx context.Context, userID, guildID string) (domain.Karma, error) GetTopKarma(ctx context.Context, guildID string) ([]domain.Karma, error) IncrementKarma(ctx context.Context, userID, guildID string) (domain.Karma, error) }
IUseCase is the user use case interface.
func NewUseCase ¶
func NewUseCase(repo IRepository) IUseCase
type SQLRepository ¶
func (SQLRepository) CreateKarma ¶
func (SQLRepository) GetKarmaByGuildID ¶
func (SQLRepository) GetKarmaByUserIDAndGuildID ¶
func (SQLRepository) GetTopKarmaByGuildID ¶
func (SQLRepository) UpdateKarma ¶
type UseCase ¶
type UseCase struct {
IRepository
}
func (UseCase) CreateKarma ¶
func (UseCase) GetTopKarma ¶
func (UseCase) IncrementKarma ¶
Click to show internal directories.
Click to hide internal directories.