Documentation ¶
Overview ¶
Package segment provides the data segment.
Index ¶
- Constants
- Variables
- type ReadWriterAt
- type Segment
- func (seg *Segment) Dec(offset int64, d ...interface{}) error
- func (seg *Segment) Get(offset int64, v ...interface{}) error
- func (seg *Segment) Inc(offset int64, d ...interface{}) error
- func (seg *Segment) Set(offset int64, v ...interface{}) error
- func (seg *Segment) Swap(offset int64, v ...interface{}) error
Constants ¶
View Source
const ( Uint8Size = 1 << iota Uint16Size Uint32Size Uint64Size )
Sizes of the unsigned integer types in bytes.
Variables ¶
View Source
var ErrUnknown = fmt.Errorf("segment: unknown value")
ErrUnknown is the error which returns when the given value has an unknown type.
Functions ¶
This section is empty.
Types ¶
type ReadWriterAt ¶
ReadWriterAt is the interface that groups the basic io.ReadAt and io.WriteAt methods.
type Segment ¶
type Segment struct {
// contains filtered or unexported fields
}
Segment is a data segment. The supported data types are uint8, uint16, uint32 and uint64. All numeric values stored in the big-endian byte order.
func New ¶
func New(driver ReadWriterAt) *Segment
New returns a new data segment based on the given data access driver.
func (*Segment) Dec ¶
Dec sequentially decreases values starting from the given offset using deltas specified by d.
func (*Segment) Inc ¶
Inc sequentially increases values starting from the given offset using deltas specified by d.
Click to show internal directories.
Click to hide internal directories.