entry

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CanUnmarshal added in v0.4.0

func CanUnmarshal(size int64) bool

CanUnmarshal returns whether the entry may be might be unmarshaled based on the size.

Types

type Entry

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

Entry provides addition of metadata to a data reference. Implements collection.Entry.

func New

func New(reference, metadata swarm.Address) *Entry

New creates a new Entry.

func (*Entry) MarshalBinary

func (e *Entry) MarshalBinary() ([]byte, error)

MarshalBinary implements encoding.BinaryMarshaler

func (*Entry) Metadata

func (e *Entry) Metadata() swarm.Address

Metadata implements collection.Entry

func (*Entry) Reference

func (e *Entry) Reference() swarm.Address

Reference implements collection.Entry

func (*Entry) UnmarshalBinary

func (e *Entry) UnmarshalBinary(b []byte) error

UnmarshalBinary implements encoding.BinaryUnmarshaler

type Metadata

type Metadata struct {
	MimeType string `json:"mimetype"`
	Filename string `json:"filename"`
}

Metadata provides mime type and filename to file entry.

func NewMetadata

func NewMetadata(fileName string) *Metadata

NewMetadata creates a new Metadata.

func (*Metadata) String

func (m *Metadata) String() string

Jump to

Keyboard shortcuts

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