Documentation ¶
Index ¶
- type AuthRepository
- type Authorization
- type Repository
- type Todo
- type TodoRepository
- func (r *TodoRepository) Create(ctx context.Context, todo model.Todo) error
- func (r *TodoRepository) Delete(ctx context.Context, todoID primitive.ObjectID, userID primitive.ObjectID) error
- func (r *TodoRepository) FindAll(ctx context.Context, userID primitive.ObjectID) ([]*model.Todo, error)
- func (r *TodoRepository) FindCompletedTodos(ctx context.Context, userID primitive.ObjectID) ([]*model.Todo, error)
- func (r *TodoRepository) FindImportantTodos(ctx context.Context, userID primitive.ObjectID) ([]*model.Todo, error)
- func (r *TodoRepository) FindUncompletedTodos(ctx context.Context, userID primitive.ObjectID) ([]*model.Todo, error)
- func (r *TodoRepository) Update(ctx context.Context, todoID primitive.ObjectID, userID primitive.ObjectID, ...) error
- type User
- type UserRepository
- func (r *UserRepository) FindById(ctx context.Context, userID primitive.ObjectID) *mongo.SingleResult
- func (r *UserRepository) FindByUsername(ctx context.Context, username string) *mongo.SingleResult
- func (r *UserRepository) UpdateUsername(ctx context.Context, userID primitive.ObjectID, newUsername string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthRepository ¶
type AuthRepository struct {
// contains filtered or unexported fields
}
func NewAuthRepository ¶
func NewAuthRepository(db *mongo.Database) *AuthRepository
func (*AuthRepository) CreateUser ¶
type Authorization ¶
type Repository ¶
type Repository struct { Authorization User Todo }
func New ¶
func New(db *mongo.Database) *Repository
type Todo ¶
type Todo interface { Create(ctx context.Context, todo model.Todo) error FindAll(ctx context.Context, userID primitive.ObjectID) ([]*model.Todo, error) Update(ctx context.Context, todoID primitive.ObjectID, userID primitive.ObjectID, options model.TodoUpdateOptions) error Delete(ctx context.Context, todoID primitive.ObjectID, userID primitive.ObjectID) error FindCompletedTodos(ctx context.Context, userID primitive.ObjectID) ([]*model.Todo, error) FindImportantTodos(ctx context.Context, userID primitive.ObjectID) ([]*model.Todo, error) FindUncompletedTodos(ctx context.Context, userID primitive.ObjectID) ([]*model.Todo, error) }
type TodoRepository ¶
type TodoRepository struct {
// contains filtered or unexported fields
}
func NewTodoRepository ¶
func NewTodoRepository(db *mongo.Database) *TodoRepository
func (*TodoRepository) FindCompletedTodos ¶
func (*TodoRepository) FindImportantTodos ¶
func (*TodoRepository) FindUncompletedTodos ¶
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(db *mongo.Database) *UserRepository
func (*UserRepository) FindById ¶
func (r *UserRepository) FindById(ctx context.Context, userID primitive.ObjectID) *mongo.SingleResult
func (*UserRepository) FindByUsername ¶
func (r *UserRepository) FindByUsername(ctx context.Context, username string) *mongo.SingleResult
func (*UserRepository) UpdateUsername ¶
Click to show internal directories.
Click to hide internal directories.