types

package
v0.0.0-...-d8c34b0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NeedleIdSize  = 8
	NeedleIdEmpty = 0
)
View Source
const (
	SizeSize           = 4 // uint32 size
	NeedleHeaderSize   = CookieSize + NeedleIdSize + SizeSize
	NeedleMapEntrySize = NeedleIdSize + OffsetSize + SizeSize
	TimestampSize      = 8 // int64 size
	NeedlePaddingSize  = 8
	TombstoneFileSize  = math.MaxUint32
	CookieSize         = 4
)
View Source
const (
	OffsetSize            = 4
	MaxPossibleVolumeSize = 4 * 1024 * 1024 * 1024 * 8 // 32GB
)

Variables

This section is empty.

Functions

func CookieToBytes

func CookieToBytes(bytes []byte, cookie Cookie)

func NeedleIdToBytes

func NeedleIdToBytes(bytes []byte, needleId NeedleId)

func NeedleIdToUint64

func NeedleIdToUint64(needleId NeedleId) uint64

NeedleIdToUint64 used to send max needle id to master

func OffsetToBytes

func OffsetToBytes(bytes []byte, offset Offset)

Types

type Cookie uint32

func BytesToCookie

func BytesToCookie(bytes []byte) Cookie

func ParseCookie

func ParseCookie(cookieString string) (Cookie, error)

func Uint32ToCookie

func Uint32ToCookie(cookie uint32) Cookie

type NeedleId

type NeedleId uint64

func BytesToNeedleId

func BytesToNeedleId(bytes []byte) NeedleId

func ParseNeedleId

func ParseNeedleId(idString string) (NeedleId, error)

func Uint64ToNeedleId

func Uint64ToNeedleId(needleId uint64) NeedleId

func (NeedleId) String

func (k NeedleId) String() string

type Offset

type Offset struct {
	OffsetHigher
	OffsetLower
}

func BytesToOffset

func BytesToOffset(bytes []byte) Offset

func ToOffset

func ToOffset(offset int64) Offset

func Uint32ToOffset

func Uint32ToOffset(offset uint32) Offset

only for testing, will be removed later.

func (Offset) IsZero

func (offset Offset) IsZero() bool

func (Offset) String

func (offset Offset) String() string

func (Offset) ToAcutalOffset

func (offset Offset) ToAcutalOffset() (actualOffset int64)

type OffsetHigher

type OffsetHigher struct {
}

type OffsetLower

type OffsetLower struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL