epoch

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const Size = 8

Size is a size of Epoch in a binary form.

Variables

This section is empty.

Functions

func EQ

func EQ(e1, e2 Epoch) bool

EQ reports whether e and e2 are the same Epoch.

Function defines the relation of equality between two Epoch. Try to avoid comparison through "==" operator for better portability.

func GE

func GE(e1, e2 Epoch) bool

GE reports whether e1 is greater or equal Epoch than e2.

Method defines the "greater or equal" relation between two Epoch. Try to avoid comparison through ">=" operator for better portability.

func GT

func GT(e1, e2 Epoch) bool

GT reports whether e1 is greater Epoch than e2.

Method defines the "greater than" relation between two Epoch. Try to avoid comparison through ">" operator for better portability.

func LE

func LE(e1, e2 Epoch) bool

LE reports whether e1 is less or equal Epoch than e2.

Method defines the "less or equal" relation between two Epoch. Try to avoid comparison through "<=" operator for better portability.

func LT

func LT(e1, e2 Epoch) bool

LT reports whether e1 is less Epoch than e2.

Method defines the "less than" relation between two Epoch. Try to avoid comparison through "<" operator for better portability.

func Marshal

func Marshal(e Epoch) []byte

Marshal encodes Epoch into a binary form and returns the result.

Result slice has Size length.

func NE

func NE(e1, e2 Epoch) bool

NE reports whether e1 and e2 are the different Epoch.

Method defines the relation of inequality between two Epoch. Try to avoid comparison through "!=" operator for better portability.

func ToUint64

func ToUint64(e Epoch) uint64

ToUint64 converts Epoch value to builtin uint64.

Try to avoid direct cast for better portability.

Types

type Epoch

type Epoch uint64

Epoch represents the number of NeoFS epoch.

func FromUint64

func FromUint64(e uint64) Epoch

FromUint64 converts builtin uint64 value to Epoch.

Try to avoid direct cast for better portability.

func Sum

func Sum(a, b Epoch) Epoch

Sum returns the result of summing up two Epoch.

Function defines a binary operation of summing two Epoch. Try to avoid using operator "+" for better portability.

func (*Epoch) UnmarshalBinary

func (e *Epoch) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshals Epoch from a binary representation.

If buffer size is insufficient, io.ErrUnexpectedEOF is returned.

Jump to

Keyboard shortcuts

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