Documentation ¶
Index ¶
- func New(hosts []string, timeout time.Duration) (storage.BasicStorage, error)
- type Gateway
- type Storage
- func (s *Storage) Delete(key string, index string) error
- func (s *Storage) Exist(key string, index string) (bool, error)
- func (s *Storage) Load(key string, index string) (io.ReadCloser, error)
- func (s *Storage) Save(key string, value io.Reader) (string, error)
- func (s *Storage) Update(key string, index string, value io.Reader) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Gateway ¶
type Gateway interface { // Add performs `ipfs add` Add(key string, r io.Reader) (cid string, err error) // Cat performs `ipfs cat` to show file data Cat(key string, cid string) (closer io.ReadCloser, err error) // Unpin performs `ipfs pin rm -r` Unpin(key string, cid string) (err error) // PinLs performs `ipfs pin ls` PinLs(key string, cid string) (pinInfo map[string]shell.PinInfo, err error) }
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is implemented with IPFS cluster.
func (*Storage) Delete ¶
Delete deletes a piece of `Data` key is the identification of a piece of `Data`, and it's decided by end-users index is the index of stored data(cid in IPFS) It takes a while for the data to really be wiped
func (*Storage) Exist ¶
Exist checks existence of a piece of `Data` key is the identification of a piece of `Data`, and it's decided by end-users index is the index of stored data(cid in IPFS)
func (*Storage) Load ¶
Load loads a piece of `Data` key is the identification of a piece of `Data`, and it's decided by end-users index is the index of stored data(cid in IPFS)
Click to show internal directories.
Click to hide internal directories.