fish

package
v1.2.34 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CollectionName = "fish"

Variables

This section is empty.

Functions

This section is empty.

Types

type Fish

type Fish struct {
	UserId   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"`
	FishNum  int64              `bson:"fishNum,omitempty" json:"fishNum,omitempty"`
}

type IMongoMapper

type IMongoMapper interface {
	Insert(ctx context.Context, data *Fish) error
	FindOne(ctx context.Context, id string) (*Fish, error)
	Update(ctx context.Context, data *Fish) error
	Delete(ctx context.Context, id string) error
	Add(ctx context.Context, id string, add int64) error
	StartClient(ctx context.Context) (*mongo.Client, error)
}

func NewMongoMapper

func NewMongoMapper(config *config.Config) IMongoMapper

type MongoMapper

type MongoMapper struct {
	// contains filtered or unexported fields
}

func (*MongoMapper) Add added in v1.2.8

func (m *MongoMapper) Add(ctx context.Context, id string, add int64) error

func (*MongoMapper) Delete

func (m *MongoMapper) Delete(ctx context.Context, id string) error

func (*MongoMapper) FindOne

func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Fish, error)

func (*MongoMapper) Insert

func (m *MongoMapper) Insert(ctx context.Context, data *Fish) error

func (*MongoMapper) StartClient added in v1.2.8

func (m *MongoMapper) StartClient(ctx context.Context) (*mongo.Client, error)

func (*MongoMapper) Update

func (m *MongoMapper) Update(ctx context.Context, data *Fish) error

Jump to

Keyboard shortcuts

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