Documentation ¶
Index ¶
- type SyncedReadCloser
- func (s *SyncedReadCloser) Close() error
- func (s *SyncedReadCloser) Len() int
- func (s *SyncedReadCloser) OpenGate()
- func (s *SyncedReadCloser) OpenGateAfter(d time.Duration)
- func (s *SyncedReadCloser) Read(p []byte) (n int, err error)
- func (s *SyncedReadCloser) Seek(offset int64, whence int) (int64, error)
- func (s *SyncedReadCloser) SetOpenGate(status bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SyncedReadCloser ¶
type SyncedReadCloser struct {
// contains filtered or unexported fields
}
SyncedReadCloser is compatible with io.ReadSeeker and performs gate-based synced writes to enable race condition testing.
func NewOpenGateWithTimeout ¶
func NewOpenGateWithTimeout(r io.ReadCloser, d time.Duration) *SyncedReadCloser
NewOpenGateWithTimeout creates a new open gate with a timeout
func NewSyncedReadCloser ¶
func NewSyncedReadCloser(r io.ReadCloser) *SyncedReadCloser
NewSyncedReadCloser creates a new SyncedReadCloser instance.
func (*SyncedReadCloser) Close ¶
func (s *SyncedReadCloser) Close() error
Close closes an io.ReadSeeker
func (*SyncedReadCloser) Len ¶
func (s *SyncedReadCloser) Len() int
Len returns the length of data in reader
func (*SyncedReadCloser) OpenGate ¶
func (s *SyncedReadCloser) OpenGate()
OpenGate opens the gate allowing all requests to be completed
func (*SyncedReadCloser) OpenGateAfter ¶
func (s *SyncedReadCloser) OpenGateAfter(d time.Duration)
OpenGateAfter schedules gate to be opened after a duration
func (*SyncedReadCloser) Read ¶
func (s *SyncedReadCloser) Read(p []byte) (n int, err error)
Read implements read method for io.ReadSeeker
func (*SyncedReadCloser) Seek ¶
func (s *SyncedReadCloser) Seek(offset int64, whence int) (int64, error)
Seek implements seek method for io.ReadSeeker
func (*SyncedReadCloser) SetOpenGate ¶
func (s *SyncedReadCloser) SetOpenGate(status bool)
SetOpenGate sets the status of the blocking gate
Click to show internal directories.
Click to hide internal directories.