func (c *Client) CatStream(path string) (io.ReadCloser, error) {
	src, err := c.sh.Cat(path)
	if err != nil {
		return nil, err
	}
	return src, err
}
Cat cat file using stream
package ipfs
import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"io"
	shell "github.com/ipfs/go-ipfs-api"
	files "github.com/ipfs/go-ipfs-files"
)
type File struct {
	Reader io.Reader
	Name   string
}
type Client struct {
	host string
	sh   *shell.Shell
}
func NewClient(host string) (*Client, error) {
	sh := shell.NewShell(host)
	c := &Client{
		host: host,
		sh:   sh,
	}
	return c, nil
}
func (c *Client) Ping() error {
	if !c.sh.IsUp() {
		return errors.New("server is down")
	}
	return nil
}
type Object struct {
	Bytes string
	Hash  string
	Name  string
	Size  string
}
type AddResult struct {
	Cid     string   `json:"cid"`
	Objects []Object `json:"Objects"`
}
func (c *Client) Add(srcs ...*File) (*AddResult, error) {
	nodes := make(map[string]files.Node, len(srcs))
	for _, src := range srcs {
		nodes[src.Name] = files.NewReaderFile(src.Reader)
	}
	sf := files.NewMapDirectory(nodes)
	slf := files.NewSliceDirectory([]files.DirEntry{files.FileEntry("", sf)})
	reader := files.NewMultiFileReader(slf, true)
	resp, err := c.sh.Request("add").
		Option("recursive", true).
		Body(reader).
		Send(context.Background())
	if err != nil {
		return nil, err
	}
	defer resp.Close()
	result := new(AddResult)
	dec := json.NewDecoder(resp.Output)
	for {
		var obj Object
		err = dec.Decode(&obj)
		if err != nil {
			if err == io.EOF {
				break
			}
			return nil, err
		}
		result.Objects = append(result.Objects, obj)
		result.Cid = obj.Hash
	}
	return result, nil
}
func (c *Client) Cat(cid string) ([]byte, error) {
	src, err := c.sh.Cat(cid)
	if err != nil {
		return nil, err
	}
	buf := new(bytes.Buffer)
	_, err = io.Copy(buf, src)
	if err != nil {
		return nil, err
	}
	return buf.Bytes(), err
}