Documentation ¶
Index ¶
- type AtomicBool
- type Clock
- type DirtyTimestamp
- type GrowableByteSlice
- func (s *GrowableByteSlice) GoString() string
- func (s *GrowableByteSlice) Len() int64
- func (s *GrowableByteSlice) ReadAt(buf []byte, off int64) (n int, err error)
- func (s *GrowableByteSlice) ReadFrom(r io.Reader) (int64, error)
- func (s *GrowableByteSlice) Resize(newLen64 int64)
- func (s *GrowableByteSlice) String() string
- func (s *GrowableByteSlice) WriteAt(data []byte, off int64) (int, error)
- func (s *GrowableByteSlice) WriteTo(w io.Writer) (int64, error)
- type MockClock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AtomicBool ¶
type AtomicBool int32
func (*AtomicBool) CompareAndSwap ¶
func (b *AtomicBool) CompareAndSwap(oldVal, newVal bool) (swapped bool)
CompareAndSwap sets the value to newVal iff the current value is oldVal. If the comparison was successful, returns true.
func (*AtomicBool) Value ¶
func (b *AtomicBool) Value() bool
type DirtyTimestamp ¶
type DirtyTimestamp struct {
// contains filtered or unexported fields
}
DirtyTimestamp is a boolean flag that knows the last time it was set from false to true. Zero value is unset.
func NewDirtyTimestamp ¶
func NewDirtyTimestamp(clock Clock) *DirtyTimestamp
func (*DirtyTimestamp) Clear ¶
func (ts *DirtyTimestamp) Clear()
func (*DirtyTimestamp) HasBeenDirtyFor ¶
func (ts *DirtyTimestamp) HasBeenDirtyFor(d time.Duration) bool
func (*DirtyTimestamp) IsSet ¶
func (ts *DirtyTimestamp) IsSet() bool
func (*DirtyTimestamp) Set ¶
func (ts *DirtyTimestamp) Set()
type GrowableByteSlice ¶
type GrowableByteSlice struct {
// contains filtered or unexported fields
}
Buffer is used to hold file data in memory. Slightly different and simpler behavior than bytes.Buffer. Wraps a byte slice, and can grow it preserving existing data, truncate it larger or smaller.
Indices are specified in int64s, not ints. Currently the slice is implemented as a single underlying byte slice, so math.IntMax is the maximum length.
func (*GrowableByteSlice) GoString ¶
func (s *GrowableByteSlice) GoString() string
func (*GrowableByteSlice) Len ¶
func (s *GrowableByteSlice) Len() int64
func (*GrowableByteSlice) ReadAt ¶
func (s *GrowableByteSlice) ReadAt(buf []byte, off int64) (n int, err error)
ReadAt implements the io.ReaderAt interface.
func (*GrowableByteSlice) ReadFrom ¶
func (s *GrowableByteSlice) ReadFrom(r io.Reader) (int64, error)
ReadFrom resizes the slice to 0 then reads all of r.
func (*GrowableByteSlice) Resize ¶
func (s *GrowableByteSlice) Resize(newLen64 int64)
Resize changes the len of the slice, re-allocating if necessary, to be newLen. If the new len is larger, the "new" bytes at the end of the buffer will always be zeroed out.
func (*GrowableByteSlice) String ¶
func (s *GrowableByteSlice) String() string