Documentation ¶
Index ¶
Constants ¶
View Source
const (
UrlCollectionName = "url"
)
View Source
const (
UserCollectionName = "user"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type UrlMapper ¶
type UrlMapper interface { FindOneByPath(ctx context.Context, path string) (*db.Url, error) Insert(ctx context.Context, data *db.Url) error FindOne(ctx context.Context, id string) (*db.Url, error) Update(ctx context.Context, data *db.Url) error Delete(ctx context.Context, id primitive.ObjectID) error }
UrlMapper is an interface to be customized, add more methods here, and implement the added methods in customUrlModel.
func NewUrlMapper ¶
NewUrlMapper returns a model for the mongo.
type UserMapper ¶
type UserMapper interface { FindOneByAuth(ctx context.Context, auth db.Auth) (*db.User, error) Insert(ctx context.Context, data *db.User) error FindOne(ctx context.Context, id string) (*db.User, error) Update(ctx context.Context, data *db.User) error Delete(ctx context.Context, id string) error }
UserMapper is an interface to be customized, add more methods here, and implement the added methods in customUserMapper.
func NewUserMapper ¶
func NewUserMapper(config *config.Config) UserMapper
NewUserMapper returns a mapper for the mongo.
Click to show internal directories.
Click to hide internal directories.