ident

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsContentAddress added in v0.22.1

func IsContentAddress(addr string) bool

IsContentAddress check if addr is valid content address or partial content address

func MarshalBytes added in v0.30.0

func MarshalBytes(h hash.Hash, v []byte)

func MarshalIdentifiable added in v0.30.0

func MarshalIdentifiable(h hash.Hash, v Identifiable)

func MarshalInt64 added in v0.30.0

func MarshalInt64(h hash.Hash, v int64)

func MarshalString added in v0.30.0

func MarshalString(h hash.Hash, v string)

func MarshalStringMap added in v0.30.0

func MarshalStringMap(h hash.Hash, v map[string]string)

func MarshalStringSlice added in v0.30.0

func MarshalStringSlice(h hash.Hash, v []string)

Types

type AddressProvider added in v0.23.1

type AddressProvider interface {
	ContentAddress(entity Identifiable) string
}

type AddressType

type AddressType uint8
const (
	AddressTypeBytes AddressType = iota
	AddressTypeString
	AddressTypeInt64
	AddressTypeStringSlice
	AddressTypeStringMap
	AddressTypeEmbeddedIdentifiable
)

type AddressWriter

type AddressWriter struct {
	hash.Hash
}

func NewAddressWriter

func NewAddressWriter() *AddressWriter

func (*AddressWriter) Identity

func (b *AddressWriter) Identity() []byte

func (*AddressWriter) MarshalBytes

func (b *AddressWriter) MarshalBytes(v []byte) *AddressWriter

func (*AddressWriter) MarshalIdentifiable

func (b *AddressWriter) MarshalIdentifiable(v Identifiable) *AddressWriter

func (*AddressWriter) MarshalInt64

func (b *AddressWriter) MarshalInt64(v int64) *AddressWriter

func (*AddressWriter) MarshalString

func (b *AddressWriter) MarshalString(v string) *AddressWriter

func (*AddressWriter) MarshalStringMap

func (b *AddressWriter) MarshalStringMap(v map[string]string) *AddressWriter

func (*AddressWriter) MarshalStringSlice

func (b *AddressWriter) MarshalStringSlice(v []string) *AddressWriter

type HexAddressProvider added in v0.23.1

type HexAddressProvider struct{}

func NewHexAddressProvider added in v0.23.1

func NewHexAddressProvider() *HexAddressProvider

func (*HexAddressProvider) ContentAddress added in v0.23.1

func (*HexAddressProvider) ContentAddress(entity Identifiable) string

type Identifiable

type Identifiable interface {
	Identity() []byte
}

Jump to

Keyboard shortcuts

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