Documentation ¶
Index ¶
- type CommonJsonRepodeprecated
- type GormRepo
- type JsonDatasourceRepo
- type MongoCollectionRepodeprecated
- func (m *MongoCollectionRepo[T]) Collection() *mongo.Collection
- func (m *MongoCollectionRepo[T]) Database() *mongo.Database
- func (m *MongoCollectionRepo[T]) Dispose() error
- func (m *MongoCollectionRepo[T]) FindOne(filter interface{}) (T, error)
- func (m *MongoCollectionRepo[T]) FindPagination(filter interface{}, sort interface{}, offset int64, limit int64) (result []T, total int, err error)
- func (m *MongoCollectionRepo[T]) Status() error
- type MongoDatasourceCollection
- func (m *MongoDatasourceCollection[T]) Collection() *mongo.Collection
- func (m *MongoDatasourceCollection[T]) FindOne(filter interface{}) (T, error)
- func (m *MongoDatasourceCollection[T]) FindPagination(filter interface{}, sort interface{}, offset int64, limit int64) (result model.PaginationResult[T], err error)
- func (m *MongoDatasourceCollection[T]) Status() error
- type MongoRepodeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommonJsonRepo
deprecated
type CommonJsonRepo[T any] struct { Cfg model.FileConfig Data T Err error }
Deprecated: use JsonDatasourceRepo one instead
func NewJsonRepository
deprecated
func NewJsonRepository[T any](cfg model.FileConfig) *CommonJsonRepo[T]
Deprecated: use JsonDatasourceRepo one instead
func (*CommonJsonRepo[T]) Dispose ¶
func (j *CommonJsonRepo[T]) Dispose() error
func (*CommonJsonRepo[T]) RepoImplName ¶
func (j *CommonJsonRepo[T]) RepoImplName() scene.ImplName
func (*CommonJsonRepo[T]) Setup ¶
func (j *CommonJsonRepo[T]) Setup() error
func (*CommonJsonRepo[T]) Status ¶
func (j *CommonJsonRepo[T]) Status() error
type GormRepo ¶
func UseGormMysql ¶
func UseGormMysql[T any](ds datasource.MysqlDataSource) (*GormRepo[T], error)
type JsonDatasourceRepo ¶
type JsonDatasourceRepo[T any] struct { Data T // contains filtered or unexported fields }
func UseJsonDatasourceRepo ¶
func UseJsonDatasourceRepo[T any](datasource datasource.JsonDataSource) *JsonDatasourceRepo[T]
func (*JsonDatasourceRepo[T]) LoadData ¶
func (j *JsonDatasourceRepo[T]) LoadData() (T, error)
type MongoCollectionRepo
deprecated
type MongoCollectionRepo[T any] struct { Cfg model.DatabaseConfig // contains filtered or unexported fields }
Deprecated: use MongoDatasourceCollection instead
func NewMongoCollectionRepo ¶
func NewMongoCollectionRepo[T any](cfg model.DatabaseConfig, collection string) *MongoCollectionRepo[T]
func (*MongoCollectionRepo[T]) Collection ¶
func (m *MongoCollectionRepo[T]) Collection() *mongo.Collection
func (*MongoCollectionRepo[T]) Database ¶
func (m *MongoCollectionRepo[T]) Database() *mongo.Database
func (*MongoCollectionRepo[T]) Dispose ¶
func (m *MongoCollectionRepo[T]) Dispose() error
func (*MongoCollectionRepo[T]) FindOne ¶
func (m *MongoCollectionRepo[T]) FindOne(filter interface{}) (T, error)
func (*MongoCollectionRepo[T]) FindPagination ¶
func (m *MongoCollectionRepo[T]) FindPagination(filter interface{}, sort interface{}, offset int64, limit int64) (result []T, total int, err error)
func (*MongoCollectionRepo[T]) Status ¶
func (m *MongoCollectionRepo[T]) Status() error
type MongoDatasourceCollection ¶
type MongoDatasourceCollection[T any] struct { CollectionName string // contains filtered or unexported fields }
func UseMongoDatasourceCollection ¶
func UseMongoDatasourceCollection[T any](datasource datasource.MongoDataSource, coll string) *MongoDatasourceCollection[T]
func (*MongoDatasourceCollection[T]) Collection ¶
func (m *MongoDatasourceCollection[T]) Collection() *mongo.Collection
func (*MongoDatasourceCollection[T]) FindOne ¶
func (m *MongoDatasourceCollection[T]) FindOne(filter interface{}) (T, error)
func (*MongoDatasourceCollection[T]) FindPagination ¶
func (m *MongoDatasourceCollection[T]) FindPagination(filter interface{}, sort interface{}, offset int64, limit int64) (result model.PaginationResult[T], err error)
func (*MongoDatasourceCollection[T]) Status ¶
func (m *MongoDatasourceCollection[T]) Status() error
type MongoRepo
deprecated
type MongoRepo struct { Cfg model.DatabaseConfig // contains filtered or unexported fields }
Deprecated: use MongoDatasourceCollection instead
func NewMongoRepo ¶
func NewMongoRepo(cfg model.DatabaseConfig) *MongoRepo
Click to show internal directories.
Click to hide internal directories.