Documentation
¶
Index ¶
- Variables
- func GetExampleModelWireSet() wire.ProviderSet
- func GetKeyExampleModel(ns ...string) string
- func RegisterKeyExampleModel(ctx frame.ContextFramer, ns ...string) string
- type ExampleModel
- func (m *ExampleModel) DeleteExample(ctx context.Context, id bson.ObjectID) (bool, error)
- func (m *ExampleModel) GetExampleByID(ctx context.Context, oid string) (*entity.Example, error)
- func (m *ExampleModel) GetExamples(ctx context.Context, page, size int) ([]entity.Example, error)
- func (m *ExampleModel) SaveExample(ctx context.Context, doc *entity.Example) (bson.ObjectID, error)
- func (m *ExampleModel) SaveMany(ctx context.Context, docs []interface{}) ([]interface{}, error)
- func (m *ExampleModel) UpdateExample(ctx context.Context, upExample *entity.Example) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ExampleModelWireSet = wire.NewSet(NewExampleModel)
)
Functions ¶
func GetExampleModelWireSet ¶
func GetExampleModelWireSet() wire.ProviderSet
func RegisterKeyExampleModel ¶
func RegisterKeyExampleModel(ctx frame.ContextFramer, ns ...string) string
RegisterKeyExampleModel 注册模型到容器(延迟初始化)并返回注册key
Types ¶
type ExampleModel ¶
type ExampleModel struct {
dbmongo.MongoLocator
// contains filtered or unexported fields
}
ExampleModel Example模型,继承MongoLocator定位器接口,具备获取上下文、配置、日志、注册实例等功能 以及基本的mongodb操作能力
func NewExampleModel ¶
func NewExampleModel(ctx frame.ContextFramer) *ExampleModel
func (*ExampleModel) DeleteExample ¶
DeleteExample 删除样例文档
func (*ExampleModel) GetExampleByID ¶
GetExampleByID 根据ID获取样例文档
func (*ExampleModel) GetExamples ¶
GetExamples 获取样例文档列表
func (*ExampleModel) SaveExample ¶
SaveExample 创建样例文档
func (*ExampleModel) SaveMany ¶
func (m *ExampleModel) SaveMany(ctx context.Context, docs []interface{}) ([]interface{}, error)
SaveMany 创建多个样例文档
func (*ExampleModel) UpdateExample ¶
UpdateExample 更新样例文档
Click to show internal directories.
Click to hide internal directories.