aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/manifest.go
diff options
context:
space:
mode:
authorViktor TrĂ³n <viktor.tron@gmail.com>2018-10-03 20:59:41 +0800
committerGitHub <noreply@github.com>2018-10-03 20:59:41 +0800
commite5677114dc7461fe39ebe353a4657aa4cb03fde4 (patch)
tree8605f9a8b726b158fd01b4befced1e3ba92ca1f9 /swarm/api/manifest.go
parent303b99663e963a520aaa44eca68e042d9fe230af (diff)
parentde01178c18766b9f744acc94fe2b96804f998e40 (diff)
downloadgo-tangerine-e5677114dc7461fe39ebe353a4657aa4cb03fde4.tar
go-tangerine-e5677114dc7461fe39ebe353a4657aa4cb03fde4.tar.gz
go-tangerine-e5677114dc7461fe39ebe353a4657aa4cb03fde4.tar.bz2
go-tangerine-e5677114dc7461fe39ebe353a4657aa4cb03fde4.tar.lz
go-tangerine-e5677114dc7461fe39ebe353a4657aa4cb03fde4.tar.xz
go-tangerine-e5677114dc7461fe39ebe353a4657aa4cb03fde4.tar.zst
go-tangerine-e5677114dc7461fe39ebe353a4657aa4cb03fde4.zip
Merge pull request #17796 from epiclabs-io/mru-feeds
swarm/storage/feeds: Renamed MRU to Swarm Feeds
Diffstat (limited to 'swarm/api/manifest.go')
-rw-r--r--swarm/api/manifest.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go
index 06be7323e..7c4cc88e4 100644
--- a/swarm/api/manifest.go
+++ b/swarm/api/manifest.go
@@ -27,7 +27,7 @@ import (
"strings"
"time"
- "github.com/ethereum/go-ethereum/swarm/storage/mru"
+ "github.com/ethereum/go-ethereum/swarm/storage/feed"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/swarm/log"
@@ -35,8 +35,8 @@ import (
)
const (
- ManifestType = "application/bzz-manifest+json"
- ResourceContentType = "application/bzz-resource"
+ ManifestType = "application/bzz-manifest+json"
+ FeedContentType = "application/bzz-feed"
manifestSizeLimit = 5 * 1024 * 1024
)
@@ -48,15 +48,15 @@ type Manifest struct {
// ManifestEntry represents an entry in a swarm manifest
type ManifestEntry struct {
- Hash string `json:"hash,omitempty"`
- Path string `json:"path,omitempty"`
- ContentType string `json:"contentType,omitempty"`
- Mode int64 `json:"mode,omitempty"`
- Size int64 `json:"size,omitempty"`
- ModTime time.Time `json:"mod_time,omitempty"`
- Status int `json:"status,omitempty"`
- Access *AccessEntry `json:"access,omitempty"`
- ResourceView *mru.View `json:"resourceView,omitempty"`
+ Hash string `json:"hash,omitempty"`
+ Path string `json:"path,omitempty"`
+ ContentType string `json:"contentType,omitempty"`
+ Mode int64 `json:"mode,omitempty"`
+ Size int64 `json:"size,omitempty"`
+ ModTime time.Time `json:"mod_time,omitempty"`
+ Status int `json:"status,omitempty"`
+ Access *AccessEntry `json:"access,omitempty"`
+ Feed *feed.Feed `json:"feed,omitempty"`
}
// ManifestList represents the result of listing files in a manifest
@@ -80,13 +80,13 @@ func (a *API) NewManifest(ctx context.Context, toEncrypt bool) (storage.Address,
return addr, err
}
-// Manifest hack for supporting Mutable Resource Updates from the bzz: scheme
+// Manifest hack for supporting Swarm feeds from the bzz: scheme
// see swarm/api/api.go:API.Get() for more information
-func (a *API) NewResourceManifest(ctx context.Context, view *mru.View) (storage.Address, error) {
+func (a *API) NewFeedManifest(ctx context.Context, feed *feed.Feed) (storage.Address, error) {
var manifest Manifest
entry := ManifestEntry{
- ResourceView: view,
- ContentType: ResourceContentType,
+ Feed: feed,
+ ContentType: FeedContentType,
}
manifest.Entries = append(manifest.Entries, entry)
data, err := json.Marshal(&manifest)