Documentation ¶
Index ¶
- type Client
- func (c *Client) ID(ctx context.Context) (ID, error)
- func (c *Client) PinAdd(ctx context.Context, cids ...string) (PinAdd, error)
- func (c *Client) PinLs(ctx context.Context, pintype PinType, cids ...string) ([]PinLs, error)
- func (c *Client) PinRm(ctx context.Context, cids ...string) ([]string, error)
- func (c *Client) PinUpdate(ctx context.Context, oldCID, newCID string, unpin bool) ([]string, error)
- func (c *Client) SwarmConnect(ctx context.Context, addr string) error
- type ClientOption
- type ID
- type PinAdd
- type PinLs
- type PinType
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
}
Client is a client for the IPFS HTTP API.
func NewClient ¶
func NewClient(options ...ClientOption) *Client
NewClient returns a new Client created with the given options.
type ClientOption ¶
type ClientOption func(*Client)
func WithBaseURL ¶
func WithBaseURL(base string) ClientOption
WithBaseURL sets the base URL for accessing the API. The default is "http://localhost:5001".
func WithHTTPClient ¶
func WithHTTPClient(client *http.Client) ClientOption
WithHTTPClient uses the given http.Client instead of http.DefaultClient.
Click to show internal directories.
Click to hide internal directories.