Documentation ¶
Index ¶
- type Monitor
- type MonitorRepository
- type Repository
- type User
- type UserRepository
- func (r *UserRepository) Create(ctx context.Context, user domain.User) error
- func (r *UserRepository) Get(ctx context.Context, id string) (domain.User, error)
- func (r *UserRepository) UpdateBalance(ctx context.Context, discordId string, amount int) error
- func (r *UserRepository) UpdatePromo(ctx context.Context, id, promo string) error
- func (r *UserRepository) UsePromo(ctx context.Context, id, promo string, reward int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MonitorRepository ¶
type MonitorRepository struct {
// contains filtered or unexported fields
}
Monitor repository structure.
func NewMonitorRepository ¶
func NewMonitorRepository(db *mongo.Database) *MonitorRepository
Creating a new monitor repository.
type Repository ¶
Repository structure.
type User ¶
type User interface { // Creating a new user. Create(ctx context.Context, user domain.User) error // Getting a user. Get(ctx context.Context, id string) (domain.User, error) // Updating a user promo code. UpdatePromo(ctx context.Context, id, promo string) error // Using a promo code. UsePromo(ctx context.Context, id, promo string, reward int) error // Updating a user balance. UpdateBalance(ctx context.Context, id string, amount int) error }
User repository interface.
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
User repository structure.
func NewUserRepository ¶
func NewUserRepository(db *mongo.Database) *UserRepository
Creating a new user repository.
func (*UserRepository) UpdateBalance ¶
Updating a user balance.
func (*UserRepository) UpdatePromo ¶
func (r *UserRepository) UpdatePromo(ctx context.Context, id, promo string) error
Updating a user promo code.
Click to show internal directories.
Click to hide internal directories.