Documentation ¶
Index ¶
Constants ¶
View Source
const (
MiddlewareDependencyDB = "*dbmw.Middleware"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DBConfig ¶
func (DBConfig) SchemaVersion ¶
type Middleware ¶
type Middleware struct { MaxIdleConnections int MaxOpenConnections int ConnectionMaxLifetime time.Duration // contains filtered or unexported fields }
func NewMiddleware ¶
func NewMiddleware(s *server.Server) *Middleware
func (*Middleware) Close ¶
func (m *Middleware) Close()
func (*Middleware) ConfigSchema ¶
func (m *Middleware) ConfigSchema() map[string]reflect.Type
func (*Middleware) Connections ¶
func (m *Middleware) Connections() int
func (*Middleware) Dependencies ¶
func (m *Middleware) Dependencies() []string
type TransactionMiddleware ¶
type TransactionMiddleware struct { }
TransactionMiddleware turns the DB connection in the context into a transaction.
The transaction gets committed automatically, or rolled back if an error occours.
func Begin ¶
func Begin() *TransactionMiddleware
func (*TransactionMiddleware) Dependencies ¶
func (t *TransactionMiddleware) Dependencies() []string
Click to show internal directories.
Click to hide internal directories.