Documentation
¶
Index ¶
- type MySQLConfig
- type PostgresConfig
- type SQLBackend
- func (s *SQLBackend) Close() error
- func (s *SQLBackend) GetLocks(group string) (int, error)
- func (s *SQLBackend) GetStaleLocks(ts time.Duration) ([]types.Lock, error)
- func (s *SQLBackend) HasLock(group, id string) (bool, error)
- func (s *SQLBackend) Release(group string, id string) error
- func (s *SQLBackend) Reserve(group string, id string) error
- type SQLiteConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLConfig ¶
type PostgresConfig ¶
type SQLBackend ¶
type SQLBackend struct {
// contains filtered or unexported fields
}
func NewMySQLBackend ¶
func NewMySQLBackend(cfg *MySQLConfig) (*SQLBackend, error)
func NewPostgresBackend ¶
func NewPostgresBackend(cfg *PostgresConfig) (*SQLBackend, error)
func NewSQLiteBackend ¶
func NewSQLiteBackend(cfg *SQLiteConfig) (*SQLBackend, error)
func (*SQLBackend) Close ¶
func (s *SQLBackend) Close() error
Calls all necessary finalization if necessary
func (*SQLBackend) GetLocks ¶
func (s *SQLBackend) GetLocks(group string) (int, error)
Returns the current number of locks for the given group
func (*SQLBackend) GetStaleLocks ¶
Return all locks older than x
func (*SQLBackend) HasLock ¶
func (s *SQLBackend) HasLock(group, id string) (bool, error)
Check if a given id already has a lock for this group
type SQLiteConfig ¶
type SQLiteConfig struct {
File string `yaml:"file"`
}
Click to show internal directories.
Click to hide internal directories.