Documentation ¶
Index ¶
- func ConvertToBson(value interface{}) (doc bson.D, err error)
- type Database
- func (database *Database) CreateUser(user *User) (err error)
- func (database *Database) GetUserById(id string) (user User, err error)
- func (database *Database) GetUserByUsername(username string) (user User, err error)
- func (database *Database) Login(username, password string) (token string, err error)
- func (database *Database) ObjectID(id string) primitive.ObjectID
- func (database *Database) Register(username, email, password string) bool
- func (database *Database) UpdateUser(id string, user User) (err error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToBson ¶
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
func (*Database) CreateUser ¶
func (*Database) GetUserById ¶
func (*Database) GetUserByUsername ¶
type User ¶
type User struct { Id primitive.ObjectID `bson:"_id,omitempty"` Firstname string `bson:"firstname,omitempty"` Lastname string `bson:"lastname,omitempty"` Username string `bson:"username,omitempty"` Email string `bson:"email,omitempty"` Password string `bson:"password,omitempty"` Valid bool `bson:"valid,omitempty"` }
Click to show internal directories.
Click to hide internal directories.