quickbuilder

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Overview

Package quickbuilder is designed as a replacement for the existing ipfs-files constructor for a simple way to generate synthetic directory trees.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Store

func Store(ls *ipld.LinkSystem, cb func(b *Builder) error) error

Store provides a builder context for making unixfs files and directories

Types

type Builder

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

Builder provides the linksystem context for saving files & directories

func (*Builder) NewBytesFile

func (b *Builder) NewBytesFile(data []byte) Node

NewBytesFile creates a unixfs file from byte contents

func (*Builder) NewMapDirectory

func (b *Builder) NewMapDirectory(entries map[string]Node) Node

NewMapDirectory creates a unixfs directory from a list of named entries

type Node

type Node interface {
	Size() (int64, error)
	Link() ipld.Link
}

A Node represents the most basic form of a file or directory

Jump to

Keyboard shortcuts

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