types

package
v0.0.0-...-5c6c1e7 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 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
	DataSizeSize       = 4
	NeedleMapEntrySize = NeedleIdSize + OffsetSize + SizeSize
	TimestampSize      = 8 // int64 size
	NeedlePaddingSize  = 8
	TombstoneFileSize  = Size(-1)
	CookieSize         = 4
)
View Source
const (
	OffsetSize                   = 4
	MaxPossibleVolumeSize uint64 = 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)

func SizeToBytes

func SizeToBytes(bytes []byte, size Size)

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 DiskType

type DiskType string
const (
	HardDriveType DiskType = ""
	SsdType                = "ssd"
)

func ToDiskType

func ToDiskType(vt string) (diskType DiskType)

func (DiskType) ReadableString

func (diskType DiskType) ReadableString() string

func (DiskType) String

func (diskType DiskType) String() string

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) ToActualOffset

func (offset Offset) ToActualOffset() (actualOffset int64)

type OffsetHigher

type OffsetHigher struct {
}

type OffsetLower

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

type Size

type Size int32

func BytesToSize

func BytesToSize(bytes []byte) Size

func (Size) IsDeleted

func (s Size) IsDeleted() bool

func (Size) IsValid

func (s Size) IsValid() bool

Jump to

Keyboard shortcuts

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