Documentation
¶
Index ¶
- func IsContentAddress(addr string) bool
- func MarshalBytes(h hash.Hash, v []byte)
- func MarshalIdentifiable(h hash.Hash, v Identifiable)
- func MarshalInt64(h hash.Hash, v int64)
- func MarshalString(h hash.Hash, v string)
- func MarshalStringMap(h hash.Hash, v map[string]string)
- func MarshalStringSlice(h hash.Hash, v []string)
- type AddressProvider
- type AddressType
- type AddressWriter
- func (b *AddressWriter) Identity() []byte
- func (b *AddressWriter) MarshalBytes(v []byte) *AddressWriter
- func (b *AddressWriter) MarshalIdentifiable(v Identifiable) *AddressWriter
- func (b *AddressWriter) MarshalInt64(v int64) *AddressWriter
- func (b *AddressWriter) MarshalString(v string) *AddressWriter
- func (b *AddressWriter) MarshalStringMap(v map[string]string) *AddressWriter
- func (b *AddressWriter) MarshalStringSlice(v []string) *AddressWriter
- type HexAddressProvider
- type Identifiable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsContentAddress ¶ added in v0.22.1
IsContentAddress check if addr is valid content address or partial content address
func MarshalBytes ¶ added in v0.30.0
func MarshalIdentifiable ¶ added in v0.30.0
func MarshalIdentifiable(h hash.Hash, v Identifiable)
func MarshalInt64 ¶ added in v0.30.0
func MarshalString ¶ added in v0.30.0
func MarshalStringSlice ¶ added in v0.30.0
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 ¶
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
}
Click to show internal directories.
Click to hide internal directories.