Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRedisInvalidAddr = errors.New("invalid redis address") ErrRedisKeyDoesNotExist = errors.New("key does not exist") ErrRedisInvalidPrefix = errors.New("invalid redis key prefix") ErrMaxTryGetLock = errors.New("all try get lock is failed") )
View Source
var DefPostgresOpts = PostgresOpts{
Host: "127.0.0.1",
Port: "5432",
DB: "postgres",
User: "postgres",
}
View Source
var DefRedisOpts = RedisOpts{
Host: "127.0.0.1",
Port: "6379",
DB: 0,
Prefix: "synlock",
}
View Source
var (
ErrPostgresInvalidAddr = errors.New("invalid postgres address")
)
Functions ¶
This section is empty.
Types ¶
type Postgres ¶
type Postgres struct {
// contains filtered or unexported fields
}
func NewPostgres ¶
func NewPostgres(conf PostgresOpts) (_ *Postgres, err error)
type PostgresMutex ¶
type PostgresMutex struct {
// contains filtered or unexported fields
}
func (*PostgresMutex) Lock ¶
func (s *PostgresMutex) Lock() error
func (*PostgresMutex) Unlock ¶
func (s *PostgresMutex) Unlock() error
type PostgresOpts ¶
type RedisMutex ¶
type RedisMutex struct {
// contains filtered or unexported fields
}
func (*RedisMutex) Lock ¶
func (s *RedisMutex) Lock() error
func (*RedisMutex) Unlock ¶
func (s *RedisMutex) Unlock() error
Click to show internal directories.
Click to hide internal directories.