Versions in this module Expand all Collapse all v0 v0.0.2 Apr 14, 2020 Changes in this version type LockOpts + Duration time.Duration + TimeToLive time.Duration v0.0.1 Aug 4, 2019 Changes in this version + const Forbidden + var ErrBadRequest = errors.New("Bad request") + var ErrForbidden = &Error + var ErrNotFound = errors.New("Not found") + func MergeErr(a ...error) error + func MustErr(err error) + func RunTestServiceSuite(t *testing.T, suites []ServiceBootstrap) + type CheckResponse struct + Level int + Signee string + type Error struct + Code int + Msg string + Payload interface{} + func (e *Error) Error() string + type LockOpts struct + Force bool + type LockRequest struct + Level int + Signature string + Signee string + func (r LockRequest) IsValid() bool + type LockResponse struct + PreviousSignee string + Status LockResponseStatus + func (a *LockResponse) Created() bool + func (a *LockResponse) Ok() bool + type LockResponseStatus int + const LockFailed + const LockOk + const LockRenewed + const LockTransferred + type Service interface + Check func(signature string) (CheckResponse, error) + Lock func(req LockRequest, opts *LockOpts) (LockResponse, error) + Unlock func(req UnlockRequest, opts *UnlockOpts) (UnlockResponse, error) + type ServiceBootstrap interface + CloseService func() error + OpenService func() Service + type ServiceDebug interface + SetDuration func(time.Duration) + type ServiceOpts struct + Duration time.Duration + Table string + TimeToLive time.Time + type UnlockOpts struct + type UnlockRequest struct + Signature string + Signee string + func (r UnlockRequest) IsValid() bool + type UnlockResponse struct + Status UnlockResponseStatus + func (r *UnlockResponse) Ok() bool + type UnlockResponseStatus int + const UnlockFailed + const UnlockNoLock + const UnlockOk