Documentation ¶
Index ¶
- Constants
- Variables
- func ConnectUserDB(ctx context.Context, dbURI string) (*mongo.Client, error)
- type User
- type UserDatabase
- func (db UserDatabase) DeleteUserByUsername(ctx context.Context, username string) error
- func (db UserDatabase) FindAllUsers(ctx context.Context) ([]User, error)
- func (db UserDatabase) FindUserByID(ctx context.Context, id string) (User, error)
- func (db UserDatabase) FindUserByUsername(ctx context.Context, username string) (User, error)
- func (db UserDatabase) InsertUser(ctx context.Context, u User) (string, error)
- func (db UserDatabase) UpdateUserInfo(ctx context.Context, username string, info string) error
- func (db UserDatabase) UpdateUserPassword(ctx context.Context, username string, password []byte) error
- func (db UserDatabase) UpdateUserRole(ctx context.Context, username string, role string) error
Constants ¶
View Source
const ( UserDB = "userDB" CollectionUsers = "users" )
Variables ¶
View Source
var ErrNoDocumentsModified = errors.New("no documents modified")
Functions ¶
Types ¶
type UserDatabase ¶
func (UserDatabase) DeleteUserByUsername ¶
func (db UserDatabase) DeleteUserByUsername(ctx context.Context, username string) error
func (UserDatabase) FindAllUsers ¶
func (db UserDatabase) FindAllUsers(ctx context.Context) ([]User, error)
func (UserDatabase) FindUserByID ¶
func (UserDatabase) FindUserByUsername ¶
func (UserDatabase) InsertUser ¶
func (UserDatabase) UpdateUserInfo ¶
func (UserDatabase) UpdateUserPassword ¶
func (UserDatabase) UpdateUserRole ¶
Click to show internal directories.
Click to hide internal directories.