Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LockTimeoutError ¶
type LockTimeoutError string
func (LockTimeoutError) Error ¶
func (l LockTimeoutError) Error() string
type Mutex ¶
type Mutex interface {
// TryLock attempts to acquire the lock before the deadline set by the provided context
// If the context does not define a deadline, TryLock will block until the lock is acquired
// Returns true if the lock is acquired, false otherwise
TryLock(ctx context.Context) bool
// Unlock frees this lock, if locked
// It is a run-time error if the lock is not locked on entry to Unlock.
Unlock()
}
type RacingReader ¶
type RacingReader interface {
Read(ctx context.Context, bytes []byte) (int, error)
ReadFull(ctx context.Context, bytes []byte) (int, error)
}
func NewRacingReader ¶
func NewRacingReader(reader io.Reader) RacingReader
type RacingWriter ¶
func NewRacingWriter ¶
func NewRacingWriter(writer io.Writer) RacingWriter
Click to show internal directories.
Click to hide internal directories.