label

package
v1.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const CollectionName = "label"

Variables

This section is empty.

Functions

This section is empty.

Types

type EsMapper

type EsMapper struct {
	IndexName string
	// contains filtered or unexported fields
}

func (*EsMapper) Search

func (e *EsMapper) Search(ctx context.Context, query []types.Query, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*Label, int64, error)

type IEsMapper

type IEsMapper interface {
	Search(ctx context.Context, query []types.Query, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*Label, int64, error)
}

func NewEsMapper

func NewEsMapper(config *config.Config) IEsMapper

type IMongoMapper

type IMongoMapper interface {
	Insert(ctx context.Context, data *Label) (string, error)
	FindOne(ctx context.Context, id string) (*Label, error)
	FindManyByIds(ctx context.Context, ids []string) ([]*Label, error)
	Update(ctx context.Context, data *Label) (*mongo.UpdateResult, error)
	Delete(ctx context.Context, id string) (int64, error)
	GetConn() *monc.Model
	StartClient() *mongo.Client
}

func NewMongoMapper

func NewMongoMapper(config *config.Config) IMongoMapper

type Label

type Label struct {
	ID       primitive.ObjectID `bson:"_id,omitempty" json:"id,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"`
	Score_   float64            `bson:"score_,omitempty" json:"score_,omitempty"`
}

type MongoMapper

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

func (*MongoMapper) Delete

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

func (*MongoMapper) FindManyByIds

func (m *MongoMapper) FindManyByIds(ctx context.Context, ids []string) ([]*Label, error)

func (*MongoMapper) FindOne

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

func (*MongoMapper) GetConn

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

func (*MongoMapper) Insert

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

func (*MongoMapper) StartClient

func (m *MongoMapper) StartClient() *mongo.Client

func (*MongoMapper) Update

func (m *MongoMapper) Update(ctx context.Context, data *Label) (*mongo.UpdateResult, error)

Jump to

Keyboard shortcuts

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