kubo/client/httpapi
2023-04-18 15:31:48 +02:00
..
api_test.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
api.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
apifile.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
block.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
dag.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
dht.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
errors_test.go correctness: only match CIDs matching go-cid.Cid.String output 2022-04-05 20:14:40 +02:00
errors.go chore: remove unused linter directives 2022-10-01 17:37:23 +02:00
key.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
name.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
object.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
path.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
pin.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
pubsub.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
README.md docs: adding example of connection and pinning to README (#173) 2023-03-28 12:38:24 +02:00
request.go feed through context 2019-04-04 00:37:23 -07:00
requestbuilder.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
response.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
routing.go chore: bumps for Kubo 0.18 and Routing API with stub for Put 2023-02-10 03:36:15 +01:00
swarm.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00
unixfs.go chore: migrate from go-libipfs to boxo 2023-04-18 15:31:48 +02:00

go-ipfs-http-api

standard-readme compliant GoDoc

IPFS CoreAPI implementation using HTTP API

This package is experimental and subject to change. If you need to depend on something less likely to change, please use go-ipfs-api. If you'd like the latest and greatest features, please use this package.

Documentation

https://godoc.org/github.com/ipfs/go-ipfs-http-api

Example

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

package main

import (
    "context"
    "fmt"

    ipfsClient "github.com/ipfs/go-ipfs-http-client"
    path "github.com/ipfs/interface-go-ipfs-core/path"
)

func main() {
    // "Connect" to local node
    node, err := ipfsClient.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
}

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

Want to hack on IPFS?

License

MIT