zone

package
v1.0.53 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CollectionName = "zone"

Variables

This section is empty.

Functions

This section is empty.

Types

type IMongoMapper

type IMongoMapper interface {
	Count(ctx context.Context, filter string) (int64, error)
	Insert(ctx context.Context, data *Zone) (string, error)
	FindOne(ctx context.Context, id string) (*Zone, error)
	FindMany(ctx context.Context, fopts string, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Zone, error)
	FindManyAndCount(ctx context.Context, fopts string, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Zone, int64, error)
	Update(ctx context.Context, data *Zone) error
	Delete(ctx context.Context, id string) (int64, error)
	GetConn() *monc.Model
}

func NewMongoMapper

func NewMongoMapper(config *config.Config) IMongoMapper

type MongoMapper

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

func (*MongoMapper) Count

func (m *MongoMapper) Count(ctx context.Context, fopts string) (int64, error)

func (*MongoMapper) Delete

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

func (*MongoMapper) FindMany

func (m *MongoMapper) FindMany(ctx context.Context, fopts string, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Zone, error)

func (*MongoMapper) FindManyAndCount

func (m *MongoMapper) FindManyAndCount(ctx context.Context, fopts string, popts *pagination.PaginationOptions, sorter mongop.MongoCursor) ([]*Zone, int64, error)

func (*MongoMapper) FindOne

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

func (*MongoMapper) GetConn

func (m *MongoMapper) GetConn() *monc.Model

func (*MongoMapper) Insert

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

func (*MongoMapper) Update

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

type Zone

type Zone struct {
	ID       primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
	FatherId string             `bson:"fatherId,omitempty" json:"fatherId,omitempty"`
	Value    string             `bson:"value,omitempty" json:"value,omitempty"`
	CreateAt time.Time          `bson:"createAt,omitempty" json:"createAt,omitempty"`
	UpdateAt time.Time          `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
}

Jump to

Keyboard shortcuts

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