lockman

package
v2.0.31+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(man ILockManager)

func LockClass

func LockClass(ctx context.Context, manager ILockedClass, projectId string)

func LockJointObject

func LockJointObject(ctx context.Context, model ILockedObject, model2 ILockedObject)

func LockObject

func LockObject(ctx context.Context, model ILockedObject)

func LockRawObject

func LockRawObject(ctx context.Context, resName string, resId string)

func ReleaseClass

func ReleaseClass(ctx context.Context, manager ILockedClass, projectId string)

func ReleaseJointObject

func ReleaseJointObject(ctx context.Context, model ILockedObject, model2 ILockedObject)

func ReleaseObject

func ReleaseObject(ctx context.Context, model ILockedObject)

func ReleaseRawObject

func ReleaseRawObject(ctx context.Context, resName string, resId string)

Types

type ILockManager

type ILockManager interface {
	LockKey(ctx context.Context, key string)
	UnlockKey(ctx context.Context, key string)
}

func NewInMemoryLockManager

func NewInMemoryLockManager() ILockManager

func NewNoopLockManager

func NewNoopLockManager() ILockManager

type ILockedClass

type ILockedClass interface {
	Keyword() string
}

type ILockedObject

type ILockedObject interface {
	ILockedClass
	GetId() string
}

type SInMemoryLockManager

type SInMemoryLockManager struct {
	// contains filtered or unexported fields
}

func (*SInMemoryLockManager) LockKey

func (lockman *SInMemoryLockManager) LockKey(ctx context.Context, key string)

func (*SInMemoryLockManager) UnlockKey

func (lockman *SInMemoryLockManager) UnlockKey(ctx context.Context, key string)

type SInMemoryLockOwner

type SInMemoryLockOwner struct {
	// contains filtered or unexported fields
}

type SInMemoryLockRecord

type SInMemoryLockRecord struct {
	// contains filtered or unexported fields
}

type SNoopLockManager

type SNoopLockManager struct {
}

func (*SNoopLockManager) LockKey

func (lockman *SNoopLockManager) LockKey(ctx context.Context, key string)

func (*SNoopLockManager) UnlockKey

func (lockman *SNoopLockManager) UnlockKey(ctx context.Context, key string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL