Documentation
¶
Index ¶
- Constants
- type Client
- func (c *Client) AuthDAGAdd(root, filePath string, size int) (string, error)
- func (c *Client) AuthDAGImport(size int) (string, error)
- func (c *Client) AuthDAGRemove(root, filePath string) (string, error)
- func (c *Client) AuthPost(size int) (string, error)
- func (c *Client) CreateIPNS(value string) (string, error)
- func (c *Client) DAGAdd(root, path string, data []byte) (string, error)
- func (c *Client) DAGImport(src any) (string, error)
- func (c *Client) DAGRemove(root, path string) (string, error)
- func (c *Client) Get(cid string) ([]byte, error)
- func (c *Client) GetIPNS(name string) ([]byte, error)
- func (c *Client) ImportIPNS(body *ImportIPNSReq) error
- func (c *Client) Pin(cid string) error
- func (c *Client) Post(data []byte) (string, error)
- func (c *Client) Unpin(cid string) error
- func (c *Client) UpdateIPNS(name, value string) error
- type ImportIPNSReq
Constants ¶
const (
EmptyDAGRoot = "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Gateway3 client for interacting with the Gateway3.
func NewClient ¶
NewClient creates a new Gateway3 client with the provided access key and access secret.
func (*Client) AuthDAGAdd ¶
AuthDAGAdd requests Gateway3 for an authorized redirect URL for subsequently adding a new CID and path to the existing dag.
func (*Client) AuthDAGImport ¶
AuthDAGImport requests Gateway3 for an authorized redirect URL for uploading a CAR file.
func (*Client) AuthDAGRemove ¶
AuthDAGRemove requests Gateway3 for an authorized redirect URL for subsequently removing a path from the existing dag, generating a new dag root.
func (*Client) CreateIPNS ¶
CreateIPNS creates a new IPNS record and binds it to the given CID. This function should only be used for creating a new record. To update an existing IPNS record, use the UpdateIPNS interface.
func (*Client) DAGAdd ¶
DAGAdd adds a new CID and path to the existing dag, generating a new dag root.
func (*Client) DAGImport ¶
DAGImport imports the given src input as a CAR format and returns its root CID. The `src` can be a path to a directory, a byte array or a io.Reader.
func (*Client) DAGRemove ¶
DAGRemove removes a path from the existing dag, generating a new dag root.
func (*Client) ImportIPNS ¶
func (c *Client) ImportIPNS(body *ImportIPNSReq) error
ImportIPNS imports an IPNS record using a user-side generated private key.
func (*Client) UpdateIPNS ¶
UpdateIPNS updates the value for the IPNS record specified by the given name.