model

package
v3.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2022 License: GPL-2.0 Imports: 7 Imported by: 0

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 Auth

type Auth struct {
	Type  string `bson:"type" json:"type"`
	Value string `bson:"value" json:"value"`
}

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

func NewUserModel(conn *monc.Model) UserModel

NewUserModel returns a model for the mongo.

Directories

Path Synopsis
Package mock_model is a generated GoMock package.
Package mock_model is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL