mapper

package
v1.4.34 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: GPL-2.0 Imports: 8 Imported by: 0

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

func NewUrlMapper(config *config.Config) UrlMapper

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.

Jump to

Keyboard shortcuts

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