Documentation
¶
Index ¶
- Constants
- type EsMapper
- type IEsMapper
- type IMongoMapper
- type Label
- type MongoMapper
- func (m *MongoMapper) Delete(ctx context.Context, id string) (int64, error)
- func (m *MongoMapper) FindManyByIds(ctx context.Context, ids []string) ([]*Label, error)
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Label, error)
- func (m *MongoMapper) GetConn() *monc.Model
- func (m *MongoMapper) Insert(ctx context.Context, data *Label) (string, error)
- func (m *MongoMapper) StartClient() *mongo.Client
- func (m *MongoMapper) Update(ctx context.Context, data *Label) (*mongo.UpdateResult, error)
Constants ¶
View Source
const CollectionName = "label"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IEsMapper ¶
type IEsMapper interface {
Search(ctx context.Context, query []types.Query, popts *pagination.PaginationOptions, sorter esp.EsCursor) ([]*Label, int64, error)
}
func NewEsMapper ¶
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) FindManyByIds ¶
func (*MongoMapper) GetConn ¶
func (m *MongoMapper) GetConn() *monc.Model
func (*MongoMapper) StartClient ¶
func (m *MongoMapper) StartClient() *mongo.Client
func (*MongoMapper) Update ¶
func (m *MongoMapper) Update(ctx context.Context, data *Label) (*mongo.UpdateResult, error)
Click to show internal directories.
Click to hide internal directories.