Documentation ¶
Index ¶
- Variables
- func WithTransaction(ctx context.Context, tx bun.Tx) context.Context
- type Client
- func (c *Client) Close() error
- func (c *Client) DB(ctx context.Context) DB
- func (c *Client) Ping() error
- func (c *Client) Transaction(ctx context.Context, callback func(ctx context.Context, tx bun.Tx) error) error
- func (c *Client) TransactionWithTryAdvisoryLock(ctx context.Context, key string, ...) error
- type DB
- type Logger
- type Migrator
- type NoopLogger
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDataLockTaken = errors.New("data lock taken")
)
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Transaction ¶
func (*Client) TransactionWithTryAdvisoryLock ¶
func (c *Client) TransactionWithTryAdvisoryLock(ctx context.Context, key string, callback func(ctx context.Context, tx bun.Tx) error) error
TransactionWithTryAdvisoryLock is Transaction with pg_try_advisory_xact_lock if a lock has already taken, returns error immediately
type Logger ¶
type Logger interface {
Info(args ...interface{})
}
func DefaultLogger ¶
func DefaultLogger() Logger
func NewNoopLogger ¶
func NewNoopLogger() Logger
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
type NoopLogger ¶
type NoopLogger struct{}
func (*NoopLogger) Info ¶
func (n *NoopLogger) Info(_ ...interface{})
Click to show internal directories.
Click to hide internal directories.