repos

package
v0.2.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 31, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GormRepo

type GormRepo[T any] struct {
	*gorm.DB
}

func UseGormMysql

func UseGormMysql[T any](ds datasource.MysqlDataSource) (*GormRepo[T], error)

func (*GormRepo[T]) FindPagination

func (m *GormRepo[T]) FindPagination(scope func(db *gorm.DB) *gorm.DB, offset int, limit int) (result model.PaginationResult[T], err 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

func (*MongoRepo) Database

func (m *MongoRepo) Database() *mongo.Database

func (*MongoRepo) Dispose

func (m *MongoRepo) Dispose() error

func (*MongoRepo) Status

func (m *MongoRepo) Status() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL