incr_uuid

package
v0.0.0-...-2aa8555 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int64FromBytes

func Int64FromBytes(data []byte) int64

Int64FromBytes bytes change to int64

func Int64ToBytes

func Int64ToBytes(val int64) []byte

Int64ToBytes int64 change to bytes

Types

type Offset

type Offset struct {
	TS    int64 // TS is the StartTS of the transaction
	Index int64
}

Offfset uniq id

func NewOffset

func NewOffset(ts, index int64) *Offset

NewOffset create a offset object ts is the startTS the transaction

func OffsetFromBytes

func OffsetFromBytes(d []byte) *Offset

OffsetFromBytes parses offset from bytes

func OffsetFromString

func OffsetFromString(s string) *Offset

OffsetFromString parses offset from a string

func (*Offset) Bytes

func (offset *Offset) Bytes() []byte

Bytes returns offset as bytes

func (*Offset) Next

func (offset *Offset) Next() *Offset

Next returns a greater offset

func (*Offset) String

func (offset *Offset) String() string

String returns offset as human-friendly string

type UUID

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

UUID a uuid object

func NewUUID

func NewUUID(addrs string) (*UUID, error)

NewUUID new a uuid object addrs pd addr

func (*UUID) UUID

func (uuid *UUID) UUID() (*Offset, error)

UUID get offset object

Jump to

Keyboard shortcuts

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