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 ¶
IsContentAddress check if addr is valid content address or partial content address
func MarshalBytes ¶
func MarshalIdentifiable ¶
func MarshalIdentifiable(h hash.Hash, v Identifiable)
func MarshalInt64 ¶
func MarshalString ¶
func MarshalStringSlice ¶
Types ¶
type AddressProvider ¶
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 ¶
type HexAddressProvider struct{}
func NewHexAddressProvider ¶
func NewHexAddressProvider() *HexAddressProvider
func (*HexAddressProvider) ContentAddress ¶
func (*HexAddressProvider) ContentAddress(entity Identifiable) string
type Identifiable ¶
type Identifiable interface {
Identity() []byte
}
Click to show internal directories.
Click to hide internal directories.