Documentation ¶
Index ¶
- Constants
- Variables
- func Key(args ...Any) string
- func Lock(args ...Any) (*locker, error)
- func LockOn(conn string, args ...Any) (*locker, error)
- func Locked(args ...Any) bool
- func LockedOn(conn string, args ...Any) bool
- func Unlock(args ...Any) error
- func UnlockOn(conn string, args ...Any) error
- type Config
- type Configs
- type Connect
- type Driver
- type Instance
- type Module
- func (this *Module) Config(name string, config Config)
- func (this *Module) Configs(config Configs)
- func (this *Module) Configure(global Map)
- func (this *Module) Connect()
- func (module *Module) Driver(name string, driver Driver)
- func (this *Module) Initialize()
- func (this *Module) Launch()
- func (this *Module) Lock(key string, expiries ...time.Duration) error
- func (this *Module) LockOn(conn string, key string, expiries ...time.Duration) error
- func (this *Module) Register(name string, value Any)
- func (this *Module) Terminate()
- func (this *Module) Unlock(conn, key string) error
- func (this *Module) UnlockOn(conn, key string) error
Constants ¶
View Source
const ( NAME = "MUTEX" DEFAULT = "default" )
Variables ¶
View Source
var (
ErrInvalidConnection = errors.New("Invalid mutex connection.")
)
Functions ¶
Types ¶
type Connect ¶
type Connect interface { //打开、关闭 Open() error Close() error Lock(key string, expires time.Duration) error Unlock(key string) error }
Connect 连接
Click to show internal directories.
Click to hide internal directories.