kubo/client/rpc
Jorropo f8f4b83c9c client/rpc: use streaming pin listing
This also fix a leaking goroutine bug on client/rpc.PinAPI.Ls, we would deadlock if context was canceled while writing the keys.
2023-06-05 11:49:13 +02:00
..
api_test.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
api.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
apifile.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
block.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
dag.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
dht.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
errors_test.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
errors.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
key.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
name.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
object.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
path.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
pin.go client/rpc: use streaming pin listing 2023-06-05 11:49:13 +02:00
pubsub.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
README.md client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
request.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
requestbuilder.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
response.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
routing.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
swarm.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00
unixfs.go client/rpc: rename package name to match rpc and edit migration story 2023-05-31 15:40:00 +02:00

coreiface.CoreAPI over http rpc

IPFS CoreAPI implementation using HTTP API

This packages implements coreiface.CoreAPI over the HTTP API.

Documentation

https://pkg.go.dev/github.com/ipfs/kubo/client/rpc

Example

Pin file on your local IPFS node based on its CID:

package main

import (
    "context"
    "fmt"

    "github.com/ipfs/kubo/client/rpc"
    path "github.com/ipfs/boxo/coreiface/path"
)

func main() {
    // "Connect" to local node
    node, err := rpc.NewLocalApi()
    if err != nil {
        fmt.Printf(err)
        return
    }
    // Pin a given file by its CID
    ctx := context.Background()
    cid := "bafkreidtuosuw37f5xmn65b3ksdiikajy7pwjjslzj2lxxz2vc4wdy3zku"
    p := path.New(cid)
    err = node.Pin().Add(ctx, p)
    if err != nil {
    	fmt.Printf(err)
        return
    }
    return
}