client

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: Apache-2.0, MIT Imports: 20 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) CreateProofSet

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

func (*Client) FindPiece

func (c *Client) FindPiece(ctx context.Context, piece types.Piece) (cid.Cid, bool, error)

func (*Client) GetProofSet

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

func (*Client) GetProofSetStatus

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

func (*Client) ListProofSet

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

func (*Client) ReadPiece

func (c *Client) ReadPiece(ctx context.Context, piece cid.Cid) (*types.PieceReader, error)

func (*Client) RemoveRoot

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

func (*Client) UploadPiece

func (c *Client) UploadPiece(ctx context.Context, upload types.PieceUpload) 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