Documentation ¶
Index ¶
- Constants
- type IMongoMapper
- type MongoMapper
- func (m *MongoMapper) Count(ctx context.Context, fopts string) (int64, error)
- func (m *MongoMapper) Delete(ctx context.Context, id string) (int64, error)
- func (m *MongoMapper) FindMany(ctx context.Context, fopts string, popts *pagination.PaginationOptions, ...) ([]*Zone, error)
- func (m *MongoMapper) FindManyAndCount(ctx context.Context, fopts string, popts *pagination.PaginationOptions, ...) ([]*Zone, int64, error)
- func (m *MongoMapper) FindOne(ctx context.Context, id string) (*Zone, error)
- func (m *MongoMapper) GetConn() *monc.Model
- func (m *MongoMapper) Insert(ctx context.Context, data *Zone) (string, error)
- func (m *MongoMapper) Update(ctx context.Context, data *Zone) error
- type Zone
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) 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) GetConn ¶
func (m *MongoMapper) GetConn() *monc.Model
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"` }
Click to show internal directories.
Click to hide internal directories.