Documentation
¶
Index ¶
- type MemoryStorage
- func (x *MemoryStorage) Close(ctx context.Context) error
- func (x *MemoryStorage) CreateWithVersion(ctx context.Context, lockId string, version storage.Version, ...) error
- func (x *MemoryStorage) DeleteWithVersion(ctx context.Context, lockId string, exceptedVersion storage.Version, ...) error
- func (x *MemoryStorage) Get(ctx context.Context, lockId string) (string, error)
- func (x *MemoryStorage) GetName() string
- func (x *MemoryStorage) GetTime(ctx context.Context) (time.Time, error)
- func (x *MemoryStorage) Init(ctx context.Context) error
- func (x *MemoryStorage) List(ctx context.Context) (iterator.Iterator[*storage.LockInformation], error)
- func (x *MemoryStorage) UpdateWithVersion(ctx context.Context, lockId string, ...) error
- type MemoryStorageValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryStorage ¶
type MemoryStorage struct {
// contains filtered or unexported fields
}
MemoryStorage 把锁存储在内存中,可以借助这个实现进程级别的锁,算是对内部的锁的一个扩展,但是似乎作用不是很大,仅仅是为了丰富实现... 也可以认为这个Storage是一个实现的样例,其它的存储引擎的实现可以参考此实现的逻辑
func NewMemoryStorage ¶
func NewMemoryStorage() *MemoryStorage
func (*MemoryStorage) CreateWithVersion ¶
func (x *MemoryStorage) CreateWithVersion(ctx context.Context, lockId string, version storage.Version, lockInformation *storage.LockInformation) error
func (*MemoryStorage) DeleteWithVersion ¶
func (x *MemoryStorage) DeleteWithVersion(ctx context.Context, lockId string, exceptedVersion storage.Version, lockInformation *storage.LockInformation) error
func (*MemoryStorage) GetName ¶
func (x *MemoryStorage) GetName() string
func (*MemoryStorage) List ¶
func (x *MemoryStorage) List(ctx context.Context) (iterator.Iterator[*storage.LockInformation], error)
func (*MemoryStorage) UpdateWithVersion ¶
func (x *MemoryStorage) UpdateWithVersion(ctx context.Context, lockId string, exceptedVersion, newVersion storage.Version, lockInformation *storage.LockInformation) error
Click to show internal directories.
Click to hide internal directories.