Documentation
¶
Index ¶
- Constants
- Variables
- func LockTimeout(m sync.Locker, timeout time.Duration) bool
- func LockWithTimer(m sync.Locker, timer *time.Timer) bool
- type App
- func (a *App) Close()
- func (a *App) HTTPAddr() net.Addr
- func (a *App) Lock(tp string, names []string) (uint64, error)
- func (a *App) LockTimeout(tp string, timeout time.Duration, names []string) (uint64, error)
- func (a *App) RESPAddr() net.Addr
- func (a *App) StartHTTP(addr string) error
- func (a *App) StartRESP(addr string) error
- func (a *App) Unlock(id uint64) error
- type Client
- type ClientLocker
- type KeyLockerGroup
- type LockerGroup
- type PathLockerGroup
- type RESPClient
Constants ¶
View Source
const ( KeyLockType = "key" PathLockType = "path" )
Variables ¶
View Source
var InfiniteTimeout = 30 * 24 * 3600 * time.Second
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) LockTimeout ¶
Lock with timeout and returns a lock id, you must use this id to unlock
type ClientLocker ¶
type KeyLockerGroup ¶
type KeyLockerGroup struct {
// contains filtered or unexported fields
}
func NewKeyLockerGroup ¶
func NewKeyLockerGroup() *KeyLockerGroup
func (*KeyLockerGroup) Lock ¶
func (g *KeyLockerGroup) Lock(keys ...string)
func (*KeyLockerGroup) LockTimeout ¶
func (g *KeyLockerGroup) LockTimeout(timeout time.Duration, keys ...string) bool
func (*KeyLockerGroup) Unlock ¶
func (g *KeyLockerGroup) Unlock(keys ...string)
type LockerGroup ¶
type PathLockerGroup ¶
type PathLockerGroup struct {
// contains filtered or unexported fields
}
func NewPathLockerGroup ¶
func NewPathLockerGroup() *PathLockerGroup
func (*PathLockerGroup) Lock ¶
func (g *PathLockerGroup) Lock(paths ...string)
func (*PathLockerGroup) LockTimeout ¶
func (g *PathLockerGroup) LockTimeout(timeout time.Duration, paths ...string) bool
func (*PathLockerGroup) Unlock ¶
func (g *PathLockerGroup) Unlock(paths ...string)
type RESPClient ¶
type RESPClient struct {
// contains filtered or unexported fields
}
func NewRESPClient ¶
func NewRESPClient(addr string) *RESPClient
func (*RESPClient) Close ¶
func (c *RESPClient) Close()
func (*RESPClient) GetLocker ¶
func (c *RESPClient) GetLocker(tp string, names ...string) (ClientLocker, error)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.