blob

package
v0.0.0-...-b8d4c9e Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidBlobName = errors.New("invalid blob name")
)

Functions

This section is empty.

Types

type AuthInfo

type AuthInfo struct {
	// contains filtered or unexported fields
}

AuthInfo is an opaque data that is necessary to perform update of an existing blob.

Currently used only for dynamic links, auth info contains all the necessary information to update the content of the blob. The representation is specific to the blob type

func AuthInfoFromBytes

func AuthInfoFromBytes(ai []byte) *AuthInfo

func (*AuthInfo) Bytes

func (a *AuthInfo) Bytes() []byte

func (*AuthInfo) Equal

func (a *AuthInfo) Equal(a2 *AuthInfo) bool

type IV

type IV struct {
	// contains filtered or unexported fields
}

IV

func IVFromBytes

func IVFromBytes(iv []byte) *IV

func (*IV) Bytes

func (i *IV) Bytes() []byte

func (*IV) Equal

func (i *IV) Equal(i2 *IV) bool

type Key

type Key struct {
	// contains filtered or unexported fields
}

Key with cipher type

func KeyFromBytes

func KeyFromBytes(key []byte) *Key

func (*Key) Bytes

func (k *Key) Bytes() []byte

func (*Key) Equal

func (k *Key) Equal(k2 *Key) bool

type Name

type Name struct {
	// contains filtered or unexported fields
}

Name is used to identify blobs. Internally it is a single array of bytes that represents both the type of the blob and internal hash used to create that blob. The type of the blob is not stored directly. Instead it is mixed with the hash of the blob to make sure that all bytes in the blob name are randomly distributed.

func NameFromBytes

func NameFromBytes(n []byte) (*Name, error)

func NameFromHashAndType

func NameFromHashAndType(hash []byte, t Type) (*Name, error)

NameFromHashAndType generates the name of a blob from some hash (e.g. sha256 of blob's content) and given blob type

func NameFromString

func NameFromString(s string) (*Name, error)

NameFromString decodes base58-encoded string into blob name

func (*Name) Bytes

func (b *Name) Bytes() []byte

func (*Name) Equal

func (b *Name) Equal(b2 *Name) bool

func (*Name) Hash

func (b *Name) Hash() []byte

Extracts hash from blob name

func (*Name) String

func (b *Name) String() string

Returns base58-encoded blob name

func (*Name) Type

func (b *Name) Type() Type

Extracts blob type from the name

type Type

type Type struct {
	// contains filtered or unexported fields
}

func NewType

func NewType(t byte) Type

func (Type) IDByte

func (b Type) IDByte() byte

Jump to

Keyboard shortcuts

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