blob

package
v0.0.0-...-b178995 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct {
	Hash  string      `json:"h"`
	Data  []byte      `json:"-"`
	Extra interface{} `json:"e,omitempty"`
}

Blob holds a blob hash/data pair Extra is here to temporarily attach related data

func New

func New(data []byte) *Blob

New initializes a new blob

func (*Blob) Check

func (b *Blob) Check() error

Check ensures the hash match the data

func (*Blob) IsFiletreeNode

func (b *Blob) IsFiletreeNode() bool

IsFiletreeNode returns true if the blob contains a filetree node (an encoded file/dir meta data)

func (*Blob) IsMeta

func (b *Blob) IsMeta() bool

IsMeta returns true if the blob contains "meta blob (an encoded internal data)

func (*Blob) String

func (b *Blob) String() string

String implements the Stringer interface

type SizedBlobRef

type SizedBlobRef struct {
	Hash string `json:"hash"`
	Size int    `json:"size"`
}

SizedBlobRef holds a blob hash and its size

Jump to

Keyboard shortcuts

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