client

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0, MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(endpoint *url.URL, opts ...Option) (*Client, error)

New creates a new PDP API client and automatically detects the server type

func NewFromConfig

func NewFromConfig(cfg config.Client) (*Client, error)

func (*Client) AddRoots

func (c *Client) AddRoots(ctx context.Context, proofSetID uint64, roots []types.RootAdd) (common.Hash, error)

func (*Client) AllocatePiece

func (c *Client) AllocatePiece(ctx context.Context, allocation types.PieceAllocation) (*types.AllocatedPiece, error)

func (*Client) CalculateCommP added in v0.0.18

func (c *Client) CalculateCommP(ctx context.Context, blob multihash.Multihash) (types.CalculateCommPResponse, error)

func (*Client) CreateProofSet

func (c *Client) CreateProofSet(ctx context.Context) (common.Hash, error)

func (*Client) GetProofSet

func (c *Client) GetProofSet(ctx context.Context, proofSetID uint64) (*types.ProofSet, error)

func (*Client) GetProofSetState added in v0.0.15

func (c *Client) GetProofSetState(ctx context.Context, proofSetID uint64) (*types.ProofSetState, error)

func (*Client) GetProofSetStatus

func (c *Client) GetProofSetStatus(ctx context.Context, txHash common.Hash) (*types.ProofSetStatus, error)

func (*Client) GetProviderStatus added in v0.0.17

func (c *Client) GetProviderStatus(ctx context.Context) (types.GetProviderStatusResults, error)

func (*Client) Has added in v0.0.18

func (c *Client) Has(ctx context.Context, blob multihash.Multihash) (bool, error)

func (*Client) ListProofSet

func (c *Client) ListProofSet(ctx context.Context) ([]types.ProofSet, error)

func (*Client) ParkPiece added in v0.0.18

func (c *Client) ParkPiece(ctx context.Context, params types.ParkPieceRequest) error

func (*Client) Read added in v0.0.18

func (c *Client) Read(ctx context.Context, piece multihash.Multihash, options ...types.ReadPieceOption) (*types.PieceReader, error)

func (*Client) ReadPieceURL added in v0.0.18

func (c *Client) ReadPieceURL(piece cid.Cid) (url.URL, error)

func (*Client) RegisterProvider added in v0.0.17

func (*Client) RemoveRoot

func (c *Client) RemoveRoot(ctx context.Context, proofSetID uint64, rootID uint64) (common.Hash, error)

func (*Client) Resolve added in v0.0.18

func (*Client) ResolveToBlob added in v0.0.18

func (c *Client) ResolveToBlob(ctx context.Context, piece multihash.Multihash) (multihash.Multihash, bool, error)

func (*Client) ResolveToPiece added in v0.0.18

func (c *Client) ResolveToPiece(ctx context.Context, blob multihash.Multihash) (multihash.Multihash, bool, error)

func (*Client) UploadPiece

func (c *Client) UploadPiece(ctx context.Context, upload types.PieceUpload) error

func (*Client) WritePieceURL added in v0.0.18

func (c *Client) WritePieceURL(piece uuid.UUID) (url.URL, error)

type EndpointType

type EndpointType string
const (
	GenericEndpoint EndpointType = "generic"
	PiriEndpoint    EndpointType = "piri"
)

type ErrFailedResponse

type ErrFailedResponse struct {
	StatusCode int
	Body       string
}

func (ErrFailedResponse) Error

func (e ErrFailedResponse) Error() string

type Option

type Option func(c *Client) error

func WithBearerFromSigner

func WithBearerFromSigner(id principal.Signer) Option

func WithEndpointType

func WithEndpointType(t EndpointType) Option

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

Jump to

Keyboard shortcuts

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