Documentation ¶
Overview ¶
Package locker
Laravel yyds!
Package locker is a generated GoMock package.
Index ¶
- Variables
- type Locker
- func NewDatabaseLock(timer timer.Timer, lottery [2]int, data data.Data, logger mlog.Logger) Locker
- func NewLocker(cfg *config.Config, data data.Data, logger mlog.Logger, timer timer.Timer) (Locker, error)
- func NewMemoryLock(timer timer.Timer, lottery [2]int, store *MemStore, logger mlog.Logger) Locker
- type MemItem
- type MemStore
- type MockLocker
- func (m *MockLocker) Acquire(arg0 string, arg1 int64) bool
- func (m *MockLocker) EXPECT() *MockLockerMockRecorder
- func (m *MockLocker) ForceRelease(arg0 string) bool
- func (m *MockLocker) ID() string
- func (m *MockLocker) Owner(arg0 string) string
- func (m *MockLocker) Release(arg0 string) bool
- func (m *MockLocker) RenewalAcquire(arg0 string, arg1, arg2 int64) (func(), bool)
- func (m *MockLocker) Type() string
- type MockLockerMockRecorder
- func (mr *MockLockerMockRecorder) Acquire(arg0, arg1 any) *gomock.Call
- func (mr *MockLockerMockRecorder) ForceRelease(arg0 any) *gomock.Call
- func (mr *MockLockerMockRecorder) ID() *gomock.Call
- func (mr *MockLockerMockRecorder) Owner(arg0 any) *gomock.Call
- func (mr *MockLockerMockRecorder) Release(arg0 any) *gomock.Call
- func (mr *MockLockerMockRecorder) RenewalAcquire(arg0, arg1, arg2 any) *gomock.Call
- func (mr *MockLockerMockRecorder) Type() *gomock.Call
Constants ¶
This section is empty.
Variables ¶
var WireLocker = wire.NewSet(NewLocker)
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker interface { ID() string Type() string Acquire(key string, seconds int64) bool RenewalAcquire(key string, seconds int64, renewalSeconds int64) (releaseFn func(), acquired bool) Release(key string) bool ForceRelease(key string) bool Owner(key string) string }
func NewDatabaseLock ¶
type MemStore ¶
func NewMemStore ¶
func NewMemStore() *MemStore
type MockLocker ¶
type MockLocker struct {
// contains filtered or unexported fields
}
MockLocker is a mock of Locker interface.
func NewMockLocker ¶
func NewMockLocker(ctrl *gomock.Controller) *MockLocker
NewMockLocker creates a new mock instance.
func (*MockLocker) Acquire ¶
func (m *MockLocker) Acquire(arg0 string, arg1 int64) bool
Acquire mocks base method.
func (*MockLocker) EXPECT ¶
func (m *MockLocker) EXPECT() *MockLockerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockLocker) ForceRelease ¶
func (m *MockLocker) ForceRelease(arg0 string) bool
ForceRelease mocks base method.
func (*MockLocker) Release ¶
func (m *MockLocker) Release(arg0 string) bool
Release mocks base method.
func (*MockLocker) RenewalAcquire ¶
func (m *MockLocker) RenewalAcquire(arg0 string, arg1, arg2 int64) (func(), bool)
RenewalAcquire mocks base method.
type MockLockerMockRecorder ¶
type MockLockerMockRecorder struct {
// contains filtered or unexported fields
}
MockLockerMockRecorder is the mock recorder for MockLocker.
func (*MockLockerMockRecorder) Acquire ¶
func (mr *MockLockerMockRecorder) Acquire(arg0, arg1 any) *gomock.Call
Acquire indicates an expected call of Acquire.
func (*MockLockerMockRecorder) ForceRelease ¶
func (mr *MockLockerMockRecorder) ForceRelease(arg0 any) *gomock.Call
ForceRelease indicates an expected call of ForceRelease.
func (*MockLockerMockRecorder) ID ¶
func (mr *MockLockerMockRecorder) ID() *gomock.Call
ID indicates an expected call of ID.
func (*MockLockerMockRecorder) Owner ¶
func (mr *MockLockerMockRecorder) Owner(arg0 any) *gomock.Call
Owner indicates an expected call of Owner.
func (*MockLockerMockRecorder) Release ¶
func (mr *MockLockerMockRecorder) Release(arg0 any) *gomock.Call
Release indicates an expected call of Release.
func (*MockLockerMockRecorder) RenewalAcquire ¶
func (mr *MockLockerMockRecorder) RenewalAcquire(arg0, arg1, arg2 any) *gomock.Call
RenewalAcquire indicates an expected call of RenewalAcquire.
func (*MockLockerMockRecorder) Type ¶
func (mr *MockLockerMockRecorder) Type() *gomock.Call
Type indicates an expected call of Type.