core

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBytesReaderToIpfs

func AddBytesReaderToIpfs(ctx context.Context, app *App, src io.Reader) (ipfsPath.Resolved, error)

Add a file or a directory to IPFS

func AddBytesToIpfs

func AddBytesToIpfs(ctx context.Context, app *App, src []byte) (ipfsPath.Resolved, error)

Add a file or a directory to IPFS

func AddFileToIpfs

func AddFileToIpfs(ctx context.Context, app *App, inputPath string) (ipfsPath.Resolved, error)

Add a file or a directory to IPFS

func AddFilesToIpfs

func AddFilesToIpfs(ctx context.Context, app *App, path string) error

Recursively add all files in the path to IPFS

func ConnectToPeers

func ConnectToPeers(ctx context.Context, ipfs icore.CoreAPI, peers []string) error

func CreateNode

func CreateNode(ctx context.Context, repoPath string) (*core.IpfsNode, error)

Creates an IPFS node and returns its coreAPI

func CreateRepo

func CreateRepo(path *string) (string, error)

func GetFileFromIpfs

func GetFileFromIpfs(ctx context.Context, app *App, cid string) ([]byte, error)

Get the file that was added once to IPFS

func GetUnixfsNode

func GetUnixfsNode(path string) (files.Node, error)

func SetupPlugins

func SetupPlugins(externalPluginsPath string) error

func SpawnIpfsNode

func SpawnIpfsNode(ctx context.Context, pathToRepo *string) (icore.CoreAPI, *core.IpfsNode, error)

Parses flags and spawns IPFS node

func TryImportCollections

func TryImportCollections(pbApp *pocketbase.PocketBase, path string)

Types

type App

type App struct {
	IpfsApi  iface.CoreAPI
	IpfsNode *kuboCore.IpfsNode
	// contains filtered or unexported fields
}

func (*App) AddService

func (app *App) AddService(name string, service LaunchFunc)

Add a named service with launch function

func (*App) LaunchServices

func (app *App) LaunchServices()

Launch all services with sync.WaitGroup

type LaunchFunc

type LaunchFunc func(app *App) error

type Service

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

Jump to

Keyboard shortcuts

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