Versions in this module Expand all Collapse all v0 v0.1.0 Aug 10, 2026 Changes in this version + const MaxNameLen + const MsgAcquire + const MsgAcquired + const MsgError + const MsgHeartbeat + const MsgWaiting + const Version + var ErrAdminClosed = newError(0x02, "closed by administrator") + var ErrDuplicateAcquire = newError(0x12, "duplicate ACQUIRE") + var ErrEmptyName = newError(0x14, "empty lock name") + var ErrExpectedAcquire = newError(0x11, "first message must be ACQUIRE") + var ErrInvalidLease = newError(0x17, "lease must be positive") + var ErrNameNotUTF8 = newError(0x16, "lock name is not valid UTF-8") + var ErrNameTooLong = newError(0x15, "lock name too long") + var ErrNotAuthorized = newError(0x18, "not authorized for lock") + var ErrShuttingDown = newError(0x01, "server shutting down") + var ErrUnknownMessage = newError(0x13, "unknown message type") + var ErrUnsupportedVersion = newError(0x10, "unsupported protocol version") + func AppendAcquire(dst []byte, name string, leaseMS uint32) ([]byte, error) + func AppendAcquired(dst []byte, token uint64) []byte + func AppendError(dst []byte, code uint8, reason string) []byte + func ErrCodeName(c uint8) string + func MsgName(t uint8) string + func ReadAcquireBody(r io.Reader) (version uint8, leaseMS uint32, name string, err error) + func ReadAcquiredBody(r io.Reader) (token uint64, err error) + func ReadErrorBody(r io.Reader) (code uint8, reason string, err error) + type Error struct + Code uint8 + func CodeErr(c uint8) *Error + func (e *Error) Error() string + func (e *Error) Temporary() bool