key

package
v0.0.0-...-7899014 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const HashSize = 32

Variables

View Source
var ErrBadKey = errors.New("bad key")
View Source
var ErrTooLong = errors.New("too long")

Functions

func TestHashFromString

func TestHashFromString(t *testing.T)

func TestHashValue

func TestHashValue(t *testing.T)

func TestKeyFromString

func TestKeyFromString(t *testing.T)

func TestKeyJSON

func TestKeyJSON(t *testing.T)

func TestKeyPath

func TestKeyPath(t *testing.T)

func TestNamespaceFromString

func TestNamespaceFromString(t *testing.T)

Types

type Def

type Def struct{}

func (Def) NewHashState

func (_ Def) NewHashState() NewHashState

type Hash

type Hash [HashSize]byte

func HashFromString

func HashFromString(str string) (hash Hash, err error)

func HashValue

func HashValue(value any) (ret Hash, err error)

func (Hash) String

func (h Hash) String() string

func (Hash) Valid

func (h Hash) Valid() bool

type Key

type Key struct {
	Namespace Namespace
	Hash      Hash
}

func KeyFromString

func KeyFromString(str string) (key Key, err error)

func (Key) Compare

func (k Key) Compare(key2 Key) int

func (Key) Error

func (k Key) Error() string

func (Key) MarshalJSON

func (k Key) MarshalJSON() ([]byte, error)

func (Key) String

func (k Key) String() string

func (Key) Valid

func (k Key) Valid() bool

type KeyPath

type KeyPath []Key

func (KeyPath) Same

func (k KeyPath) Same(b KeyPath) bool

type Namespace

type Namespace [8]byte

func NamespaceFromString

func NamespaceFromString(s string) (ns Namespace, err error)

func (Namespace) String

func (n Namespace) String() string

func (Namespace) Valid

func (n Namespace) Valid() bool

type NewHashState

type NewHashState func() hash.Hash

Jump to

Keyboard shortcuts

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