Documentation ¶
Index ¶
- Variables
- type Config
- type Conn
- func (c *Conn) BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
- func (c *Conn) Close() error
- func (c *Conn) Exec(ctx context.Context, stmt *sql.Stmt, args ...interface{}) (sql.Result, error)
- func (c *Conn) ExecWithoutLock(ctx context.Context, query string, args ...interface{}) (sql.Result, error)
- type Lock
- type Type
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoLock is returned when a lock can not be acquired due to normal causes. ErrNoLock = errors.New("advisory lock already taken or incompatible version") )
Static errors
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Type Type Version int // Version must match the value in engine_processing_versions exactly or no lock will be obtained. }
Config defines the parameters of the lock.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn allows using locked transactions over a single connection.
type Lock ¶
type Lock struct {
// contains filtered or unexported fields
}
A Lock is used to start "locked" transactions.
func (*Lock) BeginTx ¶
BeginTx will start a transaction with the appropriate lock in place (based on Config).
type Type ¶
type Type string
Type indicates the lock type. For TypeMessage, the RegionID is used.
const ( TypeEscalation Type = "escalation" TypeHeartbeat Type = "heartbeat" TypeNPCycle Type = "np_cycle" TypeRotation Type = "rotation" TypeSchedule Type = "schedule" TypeStatusUpdate Type = "status_update" TypeVerify Type = "verify" TypeMessage Type = "message" TypeCleanup Type = "cleanup" )
Recognized types
Click to show internal directories.
Click to hide internal directories.