ref

package
v0.0.0-...-3a06bfb Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const HUMANIZED_WIDTH = 12

Variables

This section is empty.

Functions

func AppendRaw

func AppendRaw[T Ref](b []byte, v T) []byte

func FromFastbuf

func FromFastbuf[T fromRaw[T]](r *fastbuf.R) (T, error)

func FromRaw

func FromRaw[T fromRaw[T]](p []byte) (T, error, []byte)

func FromRawExact

func FromRawExact[T fromRaw[T]](p []byte) (T, error)

func FromRawString

func FromRawString[T fromRaw[T]](p string) (T, error, string)

func FromRawStringExact

func FromRawStringExact[T fromRaw[T]](p string) (T, error)

func FromReader

func FromReader[T fromRaw[T]](r io.Reader) (T, error)

Types

type FileHash

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

func FileHashFromReader

func FileHashFromReader(r io.Reader) (FileHash, error)

func (FileHash) FmtHumanize

func (h FileHash) FmtHumanize() string

func (FileHash) FmtString

func (h FileHash) FmtString() string

func (FileHash) IsZero

func (h FileHash) IsZero() bool

func (FileHash) Raw

func (h FileHash) Raw() []byte

func (FileHash) RawString

func (h FileHash) RawString() string

func (FileHash) Sizeof

func (h FileHash) Sizeof() int

func (FileHash) WithName

func (h FileHash) WithName(name string) string

type OID

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

func NewOID

func NewOID(num uint64) OID

func (OID) FmtHumanize

func (id OID) FmtHumanize() string

func (OID) FmtString

func (id OID) FmtString() string

func (OID) IsZero

func (id OID) IsZero() bool

func (OID) Raw

func (id OID) Raw() []byte

func (OID) RawString

func (id OID) RawString() string

func (OID) Sizeof

func (id OID) Sizeof() int

func (OID) Uint64

func (id OID) Uint64() uint64

type Pair

type Pair[T1 fromRaw[T1], T2 fromRaw[T2]] struct {
	// contains filtered or unexported fields
}

func NewPair

func NewPair[T1 fromRaw[T1], T2 fromRaw[T2]](v1 T1, v2 T2) Pair[T1, T2]

func (Pair[T1, T2]) First

func (p Pair[T1, T2]) First() T1

func (Pair[T1, T2]) Raw

func (p Pair[T1, T2]) Raw() []byte

func (Pair[T1, T2]) RawString

func (p Pair[T1, T2]) RawString() string

func (Pair[T1, T2]) Second

func (p Pair[T1, T2]) Second() T2

func (Pair[T1, T2]) Sizeof

func (p Pair[T1, T2]) Sizeof() int

func (Pair[T1, T2]) Sum

func (p Pair[T1, T2]) Sum() Sha256

type Ref

type Ref interface {
	comparable
	formatter.Humanizer
	formatter.Stringer

	Sizeof() int
	IsZero() bool
	Raw() []byte
	RawString() string
}

type Sha256

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

func Sha256Sum

func Sha256Sum(p []byte) Sha256

func (Sha256) FmtHumanize

func (h Sha256) FmtHumanize() string

func (Sha256) FmtString

func (h Sha256) FmtString() string

func (Sha256) IsZero

func (h Sha256) IsZero() bool

func (Sha256) Raw

func (h Sha256) Raw() []byte

func (Sha256) RawString

func (h Sha256) RawString() string

func (Sha256) Sizeof

func (h Sha256) Sizeof() int

type Time

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

func NewTime

func NewTime(t time.Time) Time

func (Time) Compare

func (t Time) Compare(other Time) int

func (Time) FmtHumanize

func (t Time) FmtHumanize() string

func (Time) FmtString

func (t Time) FmtString() string

func (Time) IsZero

func (t Time) IsZero() bool

func (Time) Raw

func (t Time) Raw() []byte

func (Time) RawString

func (t Time) RawString() string

func (Time) Sizeof

func (t Time) Sizeof() int

func (Time) Std

func (t Time) Std() time.Time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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