protocol

package
v0.0.0-...-6d5efb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CidInfo

type CidInfo struct {
	Bytes string `json:"Bytes"`
	Hash  string `json:"Hash"`
	Name  string `json:"Name"`
	Size  string `json:"Size"`
}

type IPFS

type IPFS struct {
	// contains filtered or unexported fields
}

IPFS ipfs 客户端封装

func NewIPFS

func NewIPFS(addr string) *IPFS

func (*IPFS) Add

func (protocol *IPFS) Add(reader io.Reader) (string, error)

func (*IPFS) Cat

func (protocol *IPFS) Cat(cid string) (io.ReadCloser, error)

func (*IPFS) Del

func (protocol *IPFS) Del(cid string) error

func (*IPFS) Move

func (protocol *IPFS) Move(s, d string) error

type Protocol

type Protocol interface {
	Add(reader io.Reader) (string, error)
	Cat(cid string) (io.ReadCloser, error)
	Del(cid string) error
	Move(s, d string) error
}

Protocol 存储协议封装

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL