Documentation ¶
Index ¶
- Variables
- type GitLockHandler
- func (glh *GitLockHandler) AddLock(lock string, contents []byte, initiallyClaimed bool) (string, error)
- func (glh *GitLockHandler) BroadcastLockPool() ([]byte, error)
- func (glh *GitLockHandler) CheckLock(lockName string) (string, error)
- func (glh *GitLockHandler) ClaimLock(lockName string) (string, error)
- func (glh *GitLockHandler) GrabAvailableLock() (string, string, error)
- func (glh *GitLockHandler) RemoveLock(lockName string) (string, error)
- func (glh *GitLockHandler) ResetLock() error
- func (glh *GitLockHandler) Setup() error
- func (glh *GitLockHandler) UnclaimLock(lockName string) (string, error)
- func (glh *GitLockHandler) UpdateLock(lockName string, contents []byte) (string, error)
- type LockHandler
- type LockPool
- func (lp *LockPool) AcquireLock() (string, Version, error)
- func (lp *LockPool) AddClaimedLock(inDir string) (string, Version, error)
- func (lp *LockPool) AddUnclaimedLock(inDir string) (string, Version, error)
- func (lp *LockPool) CheckLock(inDir string) (string, Version, error)
- func (lp *LockPool) ClaimLock(lock string) (Version, error)
- func (lp *LockPool) ReleaseLock(inDir string) (string, Version, error)
- func (lp *LockPool) RemoveLock(inDir string) (string, Version, error)
- func (lp *LockPool) UpdateLock(inDir string) (string, Version, error)
- type MetadataPair
- type OutParams
- type OutRequest
- type OutResponse
- type Source
- type Version
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLockActive = errors.New("lock found")
View Source
var ErrLockConflict = errors.New("pool state out of date")
View Source
var ErrNoLocksAvailable = errors.New("no locks to claim")
Functions ¶
This section is empty.
Types ¶
type GitLockHandler ¶
type GitLockHandler struct { Source Source // contains filtered or unexported fields }
func NewGitLockHandler ¶
func NewGitLockHandler(source Source) *GitLockHandler
func (*GitLockHandler) BroadcastLockPool ¶
func (glh *GitLockHandler) BroadcastLockPool() ([]byte, error)
func (*GitLockHandler) CheckLock ¶ added in v1.4.0
func (glh *GitLockHandler) CheckLock(lockName string) (string, error)
func (*GitLockHandler) ClaimLock ¶
func (glh *GitLockHandler) ClaimLock(lockName string) (string, error)
func (*GitLockHandler) GrabAvailableLock ¶
func (glh *GitLockHandler) GrabAvailableLock() (string, string, error)
func (*GitLockHandler) RemoveLock ¶
func (glh *GitLockHandler) RemoveLock(lockName string) (string, error)
func (*GitLockHandler) ResetLock ¶
func (glh *GitLockHandler) ResetLock() error
func (*GitLockHandler) Setup ¶
func (glh *GitLockHandler) Setup() error
func (*GitLockHandler) UnclaimLock ¶
func (glh *GitLockHandler) UnclaimLock(lockName string) (string, error)
func (*GitLockHandler) UpdateLock ¶
func (glh *GitLockHandler) UpdateLock(lockName string, contents []byte) (string, error)
type LockHandler ¶
type LockHandler interface { GrabAvailableLock() (lock string, version string, err error) UnclaimLock(lock string) (version string, err error) AddLock(lock string, contents []byte, initiallyClaimed bool) (version string, err error) RemoveLock(lock string) (version string, err error) ClaimLock(lock string) (version string, err error) UpdateLock(lock string, contents []byte) (version string, err error) CheckLock(lock string) (version string, err error) Setup() error BroadcastLockPool() ([]byte, error) ResetLock() error }
type LockPool ¶
type LockPool struct { Source Source Output io.Writer LockHandler LockHandler // contains filtered or unexported fields }
func (*LockPool) AddClaimedLock ¶
func (*LockPool) AddUnclaimedLock ¶
func (*LockPool) ReleaseLock ¶
type MetadataPair ¶
type OutRequest ¶
func (OutRequest) Validate ¶
func (request OutRequest) Validate() []string
type OutResponse ¶
type OutResponse struct { Version Version `json:"version"` Metadata []MetadataPair `json:"metadata"` }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.