Documentation ¶
Index ¶
- func RegularSlashes(path string) (res string)
- type Api
- func (self *Api) Get(uri string, nameresolver bool) (reader storage.LazySectionReader, mimeType string, status int, err error)
- func (self *Api) Modify(uri, contentHash, contentType string, nameresolver bool) (newRootHash string, err error)
- func (self *Api) Put(content, contentType string) (string, error)
- func (self *Api) Resolve(hostPort string, nameresolver bool) (storage.Key, error)
- func (self *Api) Retrieve(key storage.Key) storage.LazySectionReader
- func (self *Api) Store(data io.Reader, size int64, wg *sync.WaitGroup) (key storage.Key, err error)
- type Config
- type Control
- type ErrResolve
- type FileSystem
- type Resolver
- type Response
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegularSlashes ¶
file system manifest always contains regularized paths no leading or trailing slashes, only single slashes inside
Types ¶
type Api ¶
type Api struct {
// contains filtered or unexported fields
}
Api implements webserver/file system related content storage and retrieval on top of the dpa it is the public interface of the dpa which is included in the ethereum stack
func (*Api) Get ¶
func (self *Api) Get(uri string, nameresolver bool) (reader storage.LazySectionReader, mimeType string, status int, err error)
Get uses iterative manifest retrieval and prefix matching to resolve path to content using dpa retrieve it returns a section reader, mimeType, status and an error
type Config ¶
type Config struct { // serialised/persisted fields *storage.StoreParams *storage.ChunkerParams *network.HiveParams Swap *swap.SwapParams *network.SyncParams Path string Port string PublicKey string BzzKey string EnsRoot common.Address NetworkId uint64 }
separate bzz directories allow several bzz nodes running in parallel
type Control ¶
type Control struct {
// contains filtered or unexported fields
}
func (*Control) BlockNetworkRead ¶
func (*Control) SwapEnabled ¶
func (*Control) SyncEnabled ¶
type ErrResolve ¶
type ErrResolve error
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func NewFileSystem ¶
func NewFileSystem(api *Api) *FileSystem
func (*FileSystem) Download ¶
func (self *FileSystem) Download(bzzpath, localpath string) error
Download replicates the manifest path structure on the local filesystem under localpath
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
implements a service
func NewStorage ¶
func (*Storage) Get ¶
Get retrieves the content from bzzpath and reads the response in full It returns the Response object, which serialises containing the response body as the value of the Content field NOTE: if error is non-nil, sResponse may still have partial content the actual size of which is given in len(resp.Content), while the expected size is resp.Size