Versions in this module Expand all Collapse all v1 v1.8.23 Feb 11, 2019 v1.8.22 Feb 11, 2019 Changes in this version + const AccessTypeACT + const AccessTypePK + const AccessTypePass + const DefaultHTTPListenAddr + const DefaultHTTPPort + const EMPTY_CREDENTIALS + const FeedContentType + const ManifestType + const MimeOctetStream + var AllowedDecryptDomains = []string + var DefaultKdfParams = NewKdfParams(262144, 1, 8) + var ErrCannotLoadFeedManifest = errors.New("Cannot load feed manifest") + var ErrCannotResolveFeed = errors.New("Cannot resolve Feed") + var ErrCannotResolveFeedURI = errors.New("Cannot resolve Feed URI") + var ErrDecrypt = errors.New("cant decrypt - forbidden") + var ErrDecryptDomainForbidden = errors.New("decryption request domain forbidden - can only decrypt on localhost") + var ErrNotAFeedManifest = errors.New("Not a feed manifest") + var ErrSkipManifest = errors.New("skip this manifest") + var ErrUnknownAccessType = errors.New("unknown access type (or not implemented)") + func DetectContentType(fileName string, f io.ReadSeeker) (string, error) + func DoACT(ctx *cli.Context, privateKey *ecdsa.PrivateKey, salt []byte, grantees []string, ...) (accessKey []byte, ae *AccessEntry, actManifest *Manifest, err error) + func NOOPDecrypt(*ManifestEntry) error + func NewSessionKeyPK(private *ecdsa.PrivateKey, public *ecdsa.PublicKey, salt []byte) ([]byte, error) + func NewSessionKeyPassword(password string, accessEntry *AccessEntry) ([]byte, error) + func RegularSlashes(path string) (res string) + type API struct + Decryptor func(context.Context, string) DecryptFunc + func NewAPI(fileStore *storage.FileStore, dns Resolver, feedHandler *feed.Handler, ...) (self *API) + func (a *API) AddFile(ctx context.Context, mhash, path, fname string, content []byte, ...) (storage.Address, string, error) + func (a *API) AppendFile(ctx context.Context, mhash, path, fname string, existingSize int64, ...) (storage.Address, string, error) + func (a *API) BuildDirectoryTree(ctx context.Context, mhash string, nameresolver bool) (addr storage.Address, manifestEntryMap map[string]*manifestTrieEntry, ...) + func (a *API) Delete(ctx context.Context, addr string, path string) (storage.Address, error) + func (a *API) FeedsLookup(ctx context.Context, query *feed.Query) ([]byte, error) + func (a *API) FeedsNewRequest(ctx context.Context, feed *feed.Feed) (*feed.Request, error) + func (a *API) FeedsUpdate(ctx context.Context, request *feed.Request) (storage.Address, error) + func (a *API) Get(ctx context.Context, decrypt DecryptFunc, manifestAddr storage.Address, ...) (reader storage.LazySectionReader, mimeType string, status int, ...) + func (a *API) GetDirectoryTar(ctx context.Context, decrypt DecryptFunc, uri *URI) (io.ReadCloser, error) + func (a *API) GetManifestList(ctx context.Context, decryptor DecryptFunc, addr storage.Address, ...) (list ManifestList, err error) + func (a *API) Modify(ctx context.Context, addr storage.Address, ...) (storage.Address, error) + func (a *API) NewFeedManifest(ctx context.Context, feed *feed.Feed) (storage.Address, error) + func (a *API) NewManifest(ctx context.Context, toEncrypt bool) (storage.Address, error) + func (a *API) NewManifestWalker(ctx context.Context, addr storage.Address, decrypt DecryptFunc, ...) (*ManifestWalker, error) + func (a *API) NewManifestWriter(ctx context.Context, addr storage.Address, quitC chan bool) (*ManifestWriter, error) + func (a *API) Put(ctx context.Context, content string, contentType string, toEncrypt bool) (k storage.Address, wait func(context.Context) error, err error) + func (a *API) RemoveFile(ctx context.Context, mhash string, path string, fname string, ...) (string, error) + func (a *API) Resolve(ctx context.Context, address string) (storage.Address, error) + func (a *API) ResolveFeed(ctx context.Context, uri *URI, values feed.Values) (*feed.Feed, error) + func (a *API) ResolveFeedManifest(ctx context.Context, addr storage.Address) (*feed.Feed, error) + func (a *API) ResolveURI(ctx context.Context, uri *URI, credentials string) (storage.Address, error) + func (a *API) Retrieve(ctx context.Context, addr storage.Address) (reader storage.LazySectionReader, isEncrypted bool) + func (a *API) Store(ctx context.Context, data io.Reader, size int64, toEncrypt bool) (addr storage.Address, wait func(ctx context.Context) error, err error) + func (a *API) UpdateManifest(ctx context.Context, addr storage.Address, ...) (storage.Address, error) + func (a *API) UploadTar(ctx context.Context, bodyReader io.ReadCloser, ...) (storage.Address, error) + type AccessEntry struct + Act string + KdfParams *KdfParams + Publisher string + Salt []byte + Type AccessType + func DoPK(ctx *cli.Context, privateKey *ecdsa.PrivateKey, granteePublicKey string, ...) (sessionKey []byte, ae *AccessEntry, err error) + func DoPassword(ctx *cli.Context, password string, salt []byte) (sessionKey []byte, ae *AccessEntry, err error) + func NewAccessEntryACT(publisher string, salt []byte, act string) (*AccessEntry, error) + func NewAccessEntryPK(publisher string, salt []byte) (*AccessEntry, error) + func NewAccessEntryPassword(salt []byte, kdfParams *KdfParams) (*AccessEntry, error) + func (a *AccessEntry) MarshalJSON() (out []byte, err error) + func (a *AccessEntry) UnmarshalJSON(value []byte) error + type AccessType string + type Config struct + BzzAccount string + BzzKey string + Contract common.Address + Cors string + DeliverySkipCheck bool + EnsAPIs []string + EnsRoot common.Address + LightNodeEnabled bool + ListenAddr string + MaxStreamPeerServers int + NetworkID uint64 + NodeID string + Path string + Port string + Pss *pss.PssParams + PublicKey string + Swap *swap.LocalProfile + SwapAPI string + SwapEnabled bool + SyncEnabled bool + SyncUpdateDelay time.Duration + SyncingSkipCheck bool + func NewConfig() (c *Config) + func (c *Config) Init(prvKey *ecdsa.PrivateKey) + func (c *Config) ShiftPrivateKey() (privKey *ecdsa.PrivateKey) + type Control struct + func NewControl(api *API, hive *network.Hive) *Control + func (c *Control) Hive() string + type DecryptFunc func(*ManifestEntry) error + type FileSystem struct + func NewFileSystem(api *API) *FileSystem + func (fs *FileSystem) Download(bzzpath, localpath string) error + func (fs *FileSystem) Upload(lpath, index string, toEncrypt bool) (string, error) + type KdfParams struct + N int + P int + R int + func NewKdfParams(n, p, r int) *KdfParams + type Manifest struct + Entries []ManifestEntry + func GenerateAccessControlManifest(ctx *cli.Context, ref string, accessKey []byte, ae *AccessEntry) (*Manifest, error) + type ManifestEntry struct + Access *AccessEntry + ContentType string + Feed *feed.Feed + Hash string + ModTime time.Time + Mode int64 + Path string + Size int64 + Status int + type ManifestList struct + CommonPrefixes []string + Entries []*ManifestEntry + type ManifestWalker struct + func (m *ManifestWalker) Walk(walkFn WalkFn) error + type ManifestWriter struct + func (m *ManifestWriter) AddEntry(ctx context.Context, data io.Reader, e *ManifestEntry) (addr storage.Address, err error) + func (m *ManifestWriter) RemoveEntry(path string) error + func (m *ManifestWriter) Store() (storage.Address, error) + type MultiResolver struct + func NewMultiResolver(opts ...MultiResolverOption) (m *MultiResolver) + func (m *MultiResolver) Resolve(addr string) (h common.Hash, err error) + type MultiResolverOption func(*MultiResolver) + func MultiResolverOptionWithResolver(r ResolveValidator, tld string) MultiResolverOption + type NoResolverError struct + TLD string + func NewNoResolverError(tld string) *NoResolverError + func (e *NoResolverError) Error() string + type RefEncryption struct + func NewRefEncryption(refSize int) *RefEncryption + func (re *RefEncryption) Decrypt(ref []byte, key []byte) ([]byte, error) + func (re *RefEncryption) Encrypt(ref []byte, key []byte) ([]byte, error) + type ResolveValidator interface + HeaderByNumber func(context.Context, *big.Int) (*types.Header, error) + Owner func(node [32]byte) (common.Address, error) + type Resolver interface + Resolve func(string) (common.Hash, error) + type Response struct + Content string + MimeType string + Size int64 + Status int + type Storage struct + func NewStorage(api *API) *Storage + func (s *Storage) Get(ctx context.Context, bzzpath string) (*Response, error) + func (s *Storage) Put(ctx context.Context, content string, contentType string, toEncrypt bool) (storage.Address, func(context.Context) error, error) + type URI struct + Addr string + Path string + Scheme string + func Parse(rawuri string) (*URI, error) + func (u *URI) Address() storage.Address + func (u *URI) Feed() bool + func (u *URI) Hash() bool + func (u *URI) Immutable() bool + func (u *URI) List() bool + func (u *URI) MarshalJSON() (out []byte, err error) + func (u *URI) Raw() bool + func (u *URI) String() string + func (u *URI) UnmarshalJSON(value []byte) error + type WalkFn func(entry *ManifestEntry) error