backing

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2023 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Blob

func Blob(vrw nt.ValueReadWriter, bs []byte) nt.Blob

Blob creates a noms blob from a byte slice

Note: any datas.Database satisfies nt.ValueReadWriter

func Unblob

func Unblob(blob nt.Blob) ([]byte, error)

Unblob creates a byte slice from a noms blob

Types

type Int

type Int int64

Int is an integer which can serialize itself to noms.

Noms doesn't provide a native integer type, so it's on us to handle this case. We manage it by providing this type wrapper which knows how to serialize itself to and from a base-36 string, which turns out to be enormously faster in noms than an array of bytes.

func IntFrom

func IntFrom(v nt.Value) (Int, error)

IntFrom is a bit of sugar to simplify creating an Int from a nt.Value

func (Int) MarshalNoms

func (i Int) MarshalNoms(vrw nt.ValueReadWriter) (val nt.Value, err error)

MarshalNoms satisfies the marshal.Marshaler interface

func (Int) NomsValue

func (i Int) NomsValue() nt.Value

NomsValue creates a nt.Value from this Int

As this operation cannot fail, we can expose a simpler interface than MarshalNoms.

func (*Int) UnmarshalNoms

func (i *Int) UnmarshalNoms(v nt.Value) (err error)

UnmarshalNoms satisfies the marshal.Unmarshaler interface

Jump to

Keyboard shortcuts

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