piece

package
v0.0.0-...-e477e18 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PieceCmd = &cobra.Command{
	Use: "piece",
}

Functions

This section is empty.

Types

type Audit

type Audit struct {
	util.DialerHelper
	Piece   string
	NodeURL storj.NodeURL

	Keys string   `help:"location of the identity files to sign orders"`
	Args []string `arg:""`
	// contains filtered or unexported fields
}

func (Audit) Run

func (a Audit) Run() error

type Checksum

type Checksum struct {
	Dir string `arg:""`
}

func (Checksum) Run

func (c Checksum) Run() error

type Decode

type Decode struct {
	PieceAlias string `args:""`
}

type Derive

type Derive struct {
	NodeURL     storj.NodeURL `arg:""`
	RootPieceID storj.PieceID `arg:""`
	Index       int32         `arg:""`
}

func (Derive) Run

func (d Derive) Run() error

type DownloadDRPC

type DownloadDRPC struct {
	util.Loop
	util.DialerHelper
	NodeURL storj.NodeURL `arg:"" name:"nodeurl"`
	Piece   storj.PieceID `arg:"" help:"Piece hash to download"`
	Size    int64         `arg:"" help:"size of bytes to download"`
	Keys    string        `help:"location of the identity files to sign orders"`
	Save    bool          `help:"safe piece to a file"`
}

func (*DownloadDRPC) ConnectAndDownload

func (d *DownloadDRPC) ConnectAndDownload(ctx context.Context, signer *util.KeySigner) error

func (*DownloadDRPC) Run

func (d *DownloadDRPC) Run() error

type DownloadPieceStore

type DownloadPieceStore struct {
	util.Loop
	util.DialerHelper
	NodeURL storj.NodeURL `arg:"" name:"nodeurl"`
	Piece   string        `arg:"" help:"Piece hash to download"`
	Size    int64         `arg:"" help:"size of bytes to download"`
	Keys    string        `help:"location of the identity files to sign orders"`
}

func (*DownloadPieceStore) Download

func (d *DownloadPieceStore) Download(ctx context.Context, signer *util.KeySigner) (downloaded int64, err error)

func (*DownloadPieceStore) Run

func (d *DownloadPieceStore) Run() error

type Downloader

type Downloader struct {
	OrderLimitCreator util.OrderLimitCreator
	// contains filtered or unexported fields
}

func NewDownloader

func NewDownloader(ctx context.Context, storagenodeURL string, dh *util.DialerHelper) (d Downloader, err error)

type Exist

type Exist struct {
	util.DialerHelper
	NodeURL storj.NodeURL `arg:"" name:"nodeurl"`
	Piece   string        `arg:"" help:"Piece hash to download"`
	Keys    string        `help:"location of the identity files to sign orders"`
	Save    bool          `help:"safe piece to a file"`
}

func (*Exist) Run

func (d *Exist) Run() error

type List

type List struct {
	util.DialerHelper
	Path string `arg:"" help:"key url (sj://bucket/.../key)"`
}

func (*List) Run

func (l *List) Run() error

type NoHash

type NoHash struct {
}

func (*NoHash) BlockSize

func (n2 *NoHash) BlockSize() int

func (*NoHash) Reset

func (n2 *NoHash) Reset()

func (*NoHash) Size

func (n2 *NoHash) Size() int

func (*NoHash) Sum

func (n2 *NoHash) Sum(b []byte) []byte

func (*NoHash) Write

func (n2 *NoHash) Write(p []byte) (n int, err error)

type NodeSpeed

type NodeSpeed struct {
	util.DialerHelper
	Keys string `help:"location of the identity files to sign orders"`
	Path string `arg:"" help:"key url (sj://bucket/encryptedpath)"`
}

func (*NodeSpeed) Run

func (n *NodeSpeed) Run() error

type Nodes

type Nodes struct {
	util.DialerHelper
	Path         string `arg:"" help:"key url (sj://bucket/encryptedpath)"`
	DesiredNodes int
}

func (*Nodes) OnEachNode

func (n *Nodes) OnEachNode(f func(url storj.NodeURL, id storj.PieceID, size int64) error) error

func (*Nodes) Run

func (n *Nodes) Run() error

type Piece

type Piece struct {
	UploadDrpc   UploadDrpc         `cmd:"" help:"Upload piece to the Storagenode"`
	DownloadDrpc DownloadDRPC       `cmd:"" help:"Download piece from the Storagenode"`
	List         List               `cmd:"" help:"Print out pieces for one particular object"`
	Nodes        Nodes              `cmd:"" help:"Print out piece locations with pieceID and node ID"`
	NodeSpeed    NodeSpeed          `cmd:"" help:"Download one piece from all the nodes"`
	Decode       Decode             `cmd:"" help:"Decode piece alias (from the condensed format, stored in db)"`
	DownloadPs   DownloadPieceStore `cmd:"" help:"Download piece from the Storagenode using piece store"`
	Unalias      Unalias            `cmd:"" help:"Decode node aliases"`
	Exist        Exist              `cmd:"" help:"check if piece id is on SN"`
	Audit        Audit              `cmd:"" help:"audit pieces on node"`
	Derive       Derive             `cmd:"" help:"derive piece id"`
	Checksum     Checksum           `cmd:"" help:"download piece and checks if stored checksum is fine"`
}

type PieceFinder

type PieceFinder struct {
	Downloader
}

func NewPieceFinder

func NewPieceFinder(ctx context.Context, storagenodeID string, dh *util.DialerHelper) (PieceFinder, error)

func (PieceFinder) Find

func (p PieceFinder) Find(ctx context.Context, bucketName string) error

type Unalias

type Unalias struct {
	Hex string `arg:""`
}

func (Unalias) Run

func (u Unalias) Run() error

type UploadDrpc

type UploadDrpc struct {
	util.Loop
	util.DialerHelper
	NoSync  bool                  `help:"Disable file sync on upload"`
	Hash    pb.PieceHashAlgorithm `default:"0" help:"Piece hash algorithm to use"`
	NodeURL storj.NodeURL         `arg:"" name:"nodeurl"`
	File    string                `arg:"" help:"file to upload as a piece"`
	Keys    string                `help:"location of the identity files to sign orders"`
}

func (*UploadDrpc) ConnectAndUpload

func (u *UploadDrpc) ConnectAndUpload(ctx context.Context, orderLimitCreator *util.KeySigner) (size int, id storj.PieceID, err error)

func (*UploadDrpc) Run

func (u *UploadDrpc) Run() error

func (*UploadDrpc) Upload

func (d *UploadDrpc) Upload(ctx context.Context, client pb.DRPCReplaySafePiecestoreClient, creator *util.KeySigner) (uploaded int, id storj.PieceID, err error)

Jump to

Keyboard shortcuts

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