modulepackage
0.0.2
Repository: https://github.com/godcong/go-ipfs-restapi.git
Documentation: pkg.go.dev
# README
go-ipfs-restapi
this repository is forked from github.com/ipfs/go-ipfs-api and makes some change
Install
go get -u github.com/godcong/go-ipfs-restapi
This will download the source into $GOPATH/src/github.com/godcong/go-ipfs-restapi
.
Usage
See the godocs for details on available methods. This should match the specs at ipfs/specs; however, there are still some methods which are not accounted for. If you would like to add any of them, see the contribute section below.
Example
Add a file with the contents "hello world!":
package main
import (
"fmt"
"strings"
"os"
shell "github.com/godcong/go-ipfs-restapi"
)
func main() {
// Where your local node is running on localhost:5001
sh := shell.NewShell("localhost:5001")
cid, err := sh.Add(strings.NewReader("hello world!"))
if err != nil {
fmt.Fprintf(os.Stderr, "error: %s", err)
os.Exit(1)
}
fmt.Printf("added %s", cid)
}
For a more complete example, please see: https://github.com/godcong/go-ipfs-restapi/blob/master/tests/main.go
Contribute
Contributions are welcome! Please check out the issues.
Want to hack on IPFS?
License
MIT
# Functions
NewLocalShell ...
NewRequest ...
NewShell ...
NewShellWithClient ...
OnlyHash ...
Pin ...
Progress ...
RawLeaves ...
# Constants
DefaultPathName ...
DefaultPathName ...
DefaultPathName ...
DirectPin ...
DefaultPathName ...
DirectPin ...
DirectPin ...
TRaw ...
TRaw ...
TRaw ...
TRaw ...
TRaw ...
# Structs
Error ...
IDOutput ...
IpfsObject ...
LsLink ...
LsObject ...
Message is a pubsub message.
Object ...
ObjectLink ...
ObjectStats ...
PeerInfo ...
PeersList ...
PinInfo ...
PublishResponse ...
PubSubSubscription allow you to receive pubsub records that where published on the network.
Request ...
RequestBuilder is an IPFS commands request builder.
Response ...
Shell ...
SwarmConnInfo ...
SwarmConnInfos ...
SwarmStreamInfo ...
UnixLsLink ...
UnixLsObject ...
# Type aliases
AddOpts ...