repair

package
v0.0.0-...-112cc7f Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DirectoryRepair

func DirectoryRepair(ctx context.Context, addr swarm.Address, opts ...Option) (swarm.Address, error)

DirectoryRepair takes in an older directory reference and creates a new manifest which contains all the files and the metadata. This reference can be then used to query the /bzz endpoint to serve the index document or /bzz/{reference}/{path} to query individual files

Old Entry: mantaray manifest -> Root Node (/) -> Metadata (index file/error file)

|
|-> file entry -> collection -> file reference -> file bytes
                            |
                            |-> metadata reference -> metadata bytes

New Entry: mantaray manifest -> Root Node (/) -> Metadata (index file)

|
|-> file entry -> Metadata (Filename, ContentType)
              |
              |-> File reference

func FileRepair

func FileRepair(ctx context.Context, addr swarm.Address, opts ...Option) (swarm.Address, error)

FileRepair takes in an older file reference and creates a new manifest which contains the file and the metadata. This reference can be then used to query the /bzz endpoint to serve the file

Old Entry: collection -> file reference -> file bytes

|
|-> metadata reference -> metadata bytes

New Entry: mantaray manifest -> Root Node (\) -> Metadata (index file)

|
|-> file entry -> Metadata (Filename, ContentType)
              |
              |-> File reference

Types

type Option

type Option func(*Repairer)

Option is used to supply functional options for the repairer utility

func WithAPIStore

func WithAPIStore(host string, port int, useSSL bool) Option

WithAPIStore is used to configure the API endpoint for running the utility. This could be locally running bee node or some gateway

func WithEncryption

func WithEncryption(val bool) Option

WithEncryption is used to enable encryption while creating data

func WithLogger

func WithLogger(l logging.Logger) Option

WithLogger is used to supply optional logger to see debug messages

func WithPin

func WithPin(val bool) Option

WithPin is used to enable pinning while creating data

func WithProgressUpdater

func WithProgressUpdater(upd ProgressUpdater) Option

WithProgressUpdater is used to provide updater implementation to see updates from utility

type ProgressUpdater

type ProgressUpdater interface {
	Update(string)
}

ProgressUpdater is and interface which can be implemented by client to recieve updates from the utility

type Repairer

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

Repairer is the implementation of the repairer utility

Jump to

Keyboard shortcuts

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