Documentation ¶
Index ¶
- Constants
- type Cat
- type EsMapper
- type IEsMapper
- type IMongoMapper
- type MongoMapper
- func (m *MongoMapper) Delete(ctx context.Context, id string) error
- func (m *MongoMapper) FindManyByCommunityId(ctx context.Context, communityId string, skip int64, count int64) ([]*Cat, int64, error)
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Cat, error)
- func (m *MongoMapper) Insert(ctx context.Context, data *Cat) error
- func (m *MongoMapper) Update(ctx context.Context, data *Cat) error
Constants ¶
View Source
const CollectionName = "cat"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cat ¶
type Cat struct { ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"` Age string `bson:"age,omitempty"` CommunityId string `bson:"communityId,omitempty"` Color string `bson:"color,omitempty"` Details string `bson:"details,omitempty"` Name string `bson:"name,omitempty"` Sex string `bson:"sex,omitempty"` Status int64 `bson:"status,omitempty"` Area string `bson:"area,omitempty"` IsSnipped bool `bson:"isSnipped,omitempty"` IsSterilized bool `bson:"isSterilized,omitempty"` Avatars []string `bson:"avatars,omitempty"` UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"` CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"` }
type IEsMapper ¶
type IEsMapper interface {
Search(ctx context.Context, communityId, keyword string, skip, count int) ([]*Cat, int64, error)
}
func NewEsMapper ¶
type IMongoMapper ¶
type IMongoMapper interface { Insert(ctx context.Context, data *Cat) error FindOne(ctx context.Context, id string) (*Cat, error) Update(ctx context.Context, data *Cat) error Delete(ctx context.Context, id string) error FindManyByCommunityId(ctx context.Context, communityId string, skip int64, count int64) ([]*Cat, int64, error) }
func NewMongoMapper ¶
func NewMongoMapper(config *config.Config) IMongoMapper
type MongoMapper ¶
type MongoMapper struct {
// contains filtered or unexported fields
}
func (*MongoMapper) FindManyByCommunityId ¶
Click to show internal directories.
Click to hide internal directories.