Documentation ¶
Index ¶
- Constants
- type ApiUsers
- func (au *ApiUsers) CreateUser(username string, userSecretHash string) (*ApiUsersDoc, error)
- func (au *ApiUsers) FindAll() (*[]ApiUsersDoc, error)
- func (au *ApiUsers) FindById(id primitive.ObjectID) (*ApiUsersDoc, error)
- func (au *ApiUsers) FindByKey(key string) (*ApiUsersDoc, error)
- func (au *ApiUsers) FindByName(username string) (*ApiUsersDoc, error)
- func (au *ApiUsers) UpdateLastLogin(id primitive.ObjectID) error
- type ApiUsersDoc
- type LastLogin
Constants ¶
View Source
const TableName = "api_users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiUsers ¶
type ApiUsers struct { Ctx context.Context Collection *mongo.Collection }
func New ¶
func New(ac core.AppContext) *ApiUsers
func (*ApiUsers) CreateUser ¶
func (au *ApiUsers) CreateUser(username string, userSecretHash string) (*ApiUsersDoc, error)
func (*ApiUsers) FindAll ¶
func (au *ApiUsers) FindAll() (*[]ApiUsersDoc, error)
func (*ApiUsers) FindById ¶
func (au *ApiUsers) FindById(id primitive.ObjectID) (*ApiUsersDoc, error)
func (*ApiUsers) FindByName ¶
func (au *ApiUsers) FindByName(username string) (*ApiUsersDoc, error)
type ApiUsersDoc ¶
type ApiUsersDoc struct { Id primitive.ObjectID `bson:"_id" json:"_id"` Id2 string `json:"id2"` UserName string `bson:"user_name" json:"user_name"` UserLevel int64 `bson:"user_level" json:"user_level"` UserKey string `bson:"user_key" json:"user_key"` UserSecretHash string `bson:"user_secret_hash" json:"user_secret_hash"` Mtime int64 `bson:"mtime" json:"mtime"` Ctime int64 `bson:"ctime" json:"ctime"` Status int64 `bson:"status" json:"status"` LastLogin *LastLogin `bson:"last_login" json:"last_login"` }
Click to show internal directories.
Click to hide internal directories.