Documentation ¶
Overview ¶
Code generated by goctl. DO NOT EDIT.
Index ¶
Constants ¶
View Source
const ( EmailAuthType = "email" PhoneAuthType = "phone" WechatAuthType = "wechat" )
View Source
const UserCollectionName = "user"
Variables ¶
View Source
var ( ErrNotFound = mon.ErrNotFound ErrInvalidObjectId = errors.New("invalid objectId") )
Functions ¶
This section is empty.
Types ¶
type User ¶
type User struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` Password string `bson:"password,omitempty" json:"password,omitempty"` Auth []Auth `bson:"auth,omitempty" json:"auth,omitempty"` }
type UserModel ¶
type UserModel interface { FindOneByAuth(ctx context.Context, auth Auth) (*User, error) // contains filtered or unexported methods }
UserModel is an interface to be customized, add more methods here, and implement the added methods in customUserModel.
func NewUserModel ¶
NewUserModel returns a model for the mongo.
Click to show internal directories.
Click to hide internal directories.