Documentation ¶
Index ¶
- Constants
- type MongoMapper
- func (m *MongoMapper) Delete(ctx context.Context, id string) (int64, error)
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*UserAuth, error)
- func (m *MongoMapper) FindOneByAuthKey(ctx context.Context, AuthKey string) (*UserAuth, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *UserAuth) error
- func (m *MongoMapper) Update(ctx context.Context, data *UserAuth) (*mongo.UpdateResult, error)
- type UserAuth
- type UserAuthMongoMapper
Constants ¶
View Source
const CollectionName = "UserAuth"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MongoMapper ¶
type MongoMapper struct {
// contains filtered or unexported fields
}
func (*MongoMapper) FindOneByAuthKey ¶
func (*MongoMapper) Insert ¶
func (m *MongoMapper) Insert(ctx context.Context, data *UserAuth) error
func (*MongoMapper) Update ¶
func (m *MongoMapper) Update(ctx context.Context, data *UserAuth) (*mongo.UpdateResult, error)
type UserAuth ¶
type UserAuth struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` UserId string `bson:"userId"` AuthKey string `bson:"authKey"` AuthType int32 `bson:"authType"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
type UserAuthMongoMapper ¶
type UserAuthMongoMapper interface { Insert(ctx context.Context, data *UserAuth) error FindOne(ctx context.Context, id string) (*UserAuth, error) FindOneByAuthKey(ctx context.Context, AuthKey string) (*UserAuth, error) // 根据AuthKey查找 Update(ctx context.Context, data *UserAuth) (*mongo.UpdateResult, error) Delete(ctx context.Context, id string) (int64, error) }
func NewMongoModel ¶
func NewMongoModel(config *config.Config) UserAuthMongoMapper
Click to show internal directories.
Click to hide internal directories.