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") )
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 ¶ added in v0.0.2
type Postgres struct {
// contains filtered or unexported fields
}
func NewPostgres ¶ added in v0.0.2
func NewPostgres(conf PostgresOpts) (_ *Postgres, err error)
type PostgresMutex ¶ added in v0.0.2
type PostgresMutex struct {
// contains filtered or unexported fields
}
func (*PostgresMutex) Lock ¶ added in v0.0.2
func (s *PostgresMutex) Lock() error
func (*PostgresMutex) Unlock ¶ added in v0.0.2
func (s *PostgresMutex) Unlock() error
type PostgresOpts ¶ added in v0.0.2
type RedisMutex ¶
type RedisMutex struct {
// contains filtered or unexported fields
}
func MustRedisMutex ¶ added in v0.0.2
func MustRedisMutex(mu Mutex) *RedisMutex
func (*RedisMutex) Lock ¶
func (s *RedisMutex) Lock() (err error)
func (*RedisMutex) LockContext ¶ added in v0.0.2
func (s *RedisMutex) LockContext(ctx context.Context) (err error)
func (*RedisMutex) Unlock ¶
func (s *RedisMutex) Unlock() error
Click to show internal directories.
Click to hide internal directories.