mg

package
v0.0.0-...-5d22fbd Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const Public = "public"

Variables

This section is empty.

Functions

func NewPgController

func NewPgController(dbConfig Config, entityDefinitions, baseEntities []database.DocumentBase) database.DatabaseController

Types

type Config

type Config struct {
	Host                   string
	Port                   int
	Username               string
	Password               string
	Name                   string
	Driver                 string
	Schema                 string
	IgnorePermissionDenied bool
	Timeout                int
	SSL                    string
	Clustered              bool
}

func (*Config) DSN

func (config *Config) DSN() string

func (*Config) GetTableSchema

func (config *Config) GetTableSchema() string

func (*Config) RawDSN

func (config *Config) RawDSN() string

type MongoController

type MongoController struct {
	// contains filtered or unexported fields
}

func (*MongoController) Generate

func (d *MongoController) Generate() error

func (*MongoController) GetTransactionFactory

func (d *MongoController) GetTransactionFactory() (database.MongoTransactionFactory, error)

func (*MongoController) Init

func (d *MongoController) Init() error

type MongoDatabase

type MongoDatabase struct {
	Database *mongo.Database
	Client   *mongo.Client
	DBConfig Config
}

func NewMoDatabase

func NewMoDatabase(DBConfig Config) *MongoDatabase

func (*MongoDatabase) GetMongo

func (md *MongoDatabase) GetMongo() *mongo.Database

func (*MongoDatabase) Open

func (md *MongoDatabase) Open() error

func (*MongoDatabase) OpenRaw

func (md *MongoDatabase) OpenRaw() error

type Transaction

type Transaction struct {
	// contains filtered or unexported fields
}

func (*Transaction) Begin

func (m *Transaction) Begin(_ context.Context) error

func (*Transaction) Commit

func (m *Transaction) Commit(ctx context.Context) error

func (*Transaction) GetDataContext

func (m *Transaction) GetDataContext() any

func (*Transaction) Rollback

func (m *Transaction) Rollback(ctx context.Context) error

func (*Transaction) RollbackUnlessCommitted

func (m *Transaction) RollbackUnlessCommitted(ctx context.Context)

type TransactionFactory

type TransactionFactory struct {
	// contains filtered or unexported fields
}

func (TransactionFactory) New

Jump to

Keyboard shortcuts

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