piece

package
v1.20.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License: AGPL-3.0 Imports: 39 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 {
	File string `arg:"" help:"checksum file to be used"`
}

func (*Checksum) Run

func (c *Checksum) Run() error

type Derive

type Derive struct {
	NodeID      storj.NodeID  `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 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 Hash added in v1.19.0

type Hash struct {
	File string `arg:""`
}

func (*Hash) Run added in v1.19.0

func (s *Hash) 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 Orderlimit added in v1.19.0

type Orderlimit struct {
	File string `arg:""`
}

func (*Orderlimit) Run added in v1.19.0

func (s *Orderlimit) 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"`
	Nodes        Nodes              `cmd:"" help:"Print out piece locations with pieceID and node ID"`
	NodeSpeed    NodeSpeed          `cmd:"" help:"Download one piece from all the nodes"`
	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:"check piece checksum"`
	Orderlimit   Orderlimit         `cmd:"" help:"Parse orderlimit file"`
	Hash         Hash               `cmd:"" help:"Parse piece hash file"`
}

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"`
	PieceID string                `help:"Piece ID to use for upload, if not set a new one is generated"`
}

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