Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Parameter ¶
type Parameter interface {
// contains filtered or unexported methods
}
Parameter is the interface for service parameters.
func WithLogLevel ¶
WithLogLevel sets the log level for the module.
func WithMonitor ¶
func WithMonitor(monitor metrics.LockerMonitor) Parameter
WithMonitor sets the monitor for this module.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides a global account locker using sync.Map.
func (*Service) Lock ¶
Lock acquires a lock for a given public key. If more than one lock is being acquired in a batch, ensure that PreLock() is called beforehand and PostLock() afterwards.
func (*Service) PostLock ¶ added in v1.0.1
func (s *Service) PostLock()
PostLock must be called after locking one or more public keys. It frees the locker-wide mutex obtained by PreLock().
Click to show internal directories.
Click to hide internal directories.