ipldeml

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2020 License: AGPL-3.0 Imports: 8 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.

README

ipld-eml

ipld-eml is an RFC-5322 compliant IPLD email object format. It allows taking emails and storing them as typed objects on IPFS. Emails are converted into a protocol buffer object before being stored on IPFS. Currently there are two methods of storing on IPFS, as a UnixFS object, or as a dedicated IPLD object.

unixfs

The workflow for unixfs is similar to the dedicated IPLD object, except we take the protocol buffer object, marshal it, and store it as a unixfs object

dedicated ipld object

The workflow for this involves manually chunking the email protocol buffer object into chunks of slightly under 1MB in size. These chunks are then recorded in a wrapper object, which is then stored as a unixfs object. Because individual DAG objects can't be larger than 1MB in size, otherwise they will be unable to be transferred through the network, it is possible that storing the email chunk wrapper object will be larger than 1MB in size. As such, the unixfs object type allows us to conveniently not have to deal with the maximum size of the wrapper object.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Converter

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

Converter takes eml files and converting them to an ipfs friendly version

func NewConverter

func NewConverter(ctx context.Context, xclient *client.Client) *Converter

NewConverter instantiates our new converter

func (*Converter) Convert

func (c *Converter) Convert(reader io.Reader) (*pb.Email, error)

Convert takes a reader for an eml file, and returns the ipfs hash

func (*Converter) GetEmail

func (c *Converter) GetEmail(hash string) (*pb.Email, error)

GetEmail is a helper function to retrieve an email object from ipfs, and return its protocol buffer type

func (*Converter) GetEmailChunked

func (c *Converter) GetEmailChunked(hash string) (*pb.Email, error)

GetEmailChunked is used to return an email from its chunked storage format

func (*Converter) PutEmail

func (c *Converter) PutEmail(email *pb.Email) (string, error)

PutEmail is a helper function to store an email objecto n ipfs

func (*Converter) PutEmailChunked

func (c *Converter) PutEmailChunked(email *pb.Email) (string, error)

PutEmailChunked allows storing an email as a custom ipld dag object as opposed to a unixfs object type

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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