entry

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

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