common

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 3 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 added in v0.0.7

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 added in v0.0.7

func AuthInfoFromBytes(ai []byte) *AuthInfo

func (*AuthInfo) Bytes added in v0.0.7

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

func (*AuthInfo) Equal added in v0.0.7

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

type BlobIV added in v0.0.7

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

IV

func BlobIVFromBytes added in v0.0.7

func BlobIVFromBytes(iv []byte) *BlobIV

func (*BlobIV) Bytes added in v0.0.7

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

func (*BlobIV) Equal added in v0.0.7

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

type BlobKey added in v0.0.7

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

Key with cipher type

func BlobKeyFromBytes added in v0.0.7

func BlobKeyFromBytes(key []byte) *BlobKey

func (*BlobKey) Bytes added in v0.0.7

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

func (*BlobKey) Equal added in v0.0.7

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

type BlobName

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

BlobName 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 BlobNameFromBytes added in v0.0.7

func BlobNameFromBytes(n []byte) (*BlobName, error)

func BlobNameFromHashAndType

func BlobNameFromHashAndType(hash []byte, t BlobType) (*BlobName, error)

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

func BlobNameFromString

func BlobNameFromString(s string) (*BlobName, error)

BlobNameFromString decodes base58-encoded string into blob name

func (*BlobName) Bytes added in v0.0.7

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

func (*BlobName) Equal added in v0.0.7

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

func (*BlobName) Hash

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

Extracts hash from blob name

func (*BlobName) String

func (b *BlobName) String() string

Returns base58-encoded blob name

func (*BlobName) Type

func (b *BlobName) Type() BlobType

Extracts blob type from the name

type BlobType

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

func NewBlobType

func NewBlobType(t byte) BlobType

func (BlobType) IDByte

func (b BlobType) IDByte() byte

Jump to

Keyboard shortcuts

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