diff options
Diffstat (limited to 'swarm/api')
-rw-r--r-- | swarm/api/api.go | 22 | ||||
-rw-r--r-- | swarm/api/client/client.go | 8 | ||||
-rw-r--r-- | swarm/api/http/server.go | 4 | ||||
-rw-r--r-- | swarm/api/http/server_test.go | 4 | ||||
-rw-r--r-- | swarm/api/manifest.go | 2 |
5 files changed, 20 insertions, 20 deletions
diff --git a/swarm/api/api.go b/swarm/api/api.go index c61bd8064..a23e09e68 100644 --- a/swarm/api/api.go +++ b/swarm/api/api.go @@ -404,7 +404,7 @@ func (a *API) Get(ctx context.Context, decrypt DecryptFunc, manifestAddr storage return a.Get(ctx, decrypt, adr, entry.Path) } - // we need to do some extra work if this is a Feed manifest + // we need to do some extra work if this is a Swarm feed manifest if entry.ContentType == FeedContentType { if entry.Feed == nil { return reader, mimeType, status, nil, fmt.Errorf("Cannot decode Feed in manifest") @@ -957,7 +957,7 @@ func (a *API) BuildDirectoryTree(ctx context.Context, mhash string, nameresolver return addr, manifestEntryMap, nil } -// FeedsLookup finds Swarm Feeds Updates at specific points in time, or the latest update +// FeedsLookup finds Swarm feeds updates at specific points in time, or the latest update func (a *API) FeedsLookup(ctx context.Context, query *feeds.Query) ([]byte, error) { _, err := a.feeds.Lookup(ctx, query) if err != nil { @@ -971,17 +971,17 @@ func (a *API) FeedsLookup(ctx context.Context, query *feeds.Query) ([]byte, erro return data, nil } -// FeedsNewRequest creates a Request object to update a specific Feed +// FeedsNewRequest creates a Request object to update a specific feed func (a *API) FeedsNewRequest(ctx context.Context, feed *feeds.Feed) (*feeds.Request, error) { return a.feeds.NewRequest(ctx, feed) } -// FeedsUpdate publishes a new update on the given Feed +// FeedsUpdate publishes a new update on the given feed func (a *API) FeedsUpdate(ctx context.Context, request *feeds.Request) (storage.Address, error) { return a.feeds.Update(ctx, request) } -// FeedsHashSize returned the size of the digest produced by Swarm Feeds' hashing function +// FeedsHashSize returned the size of the digest produced by Swarm feeds' hashing function func (a *API) FeedsHashSize() int { return a.feeds.HashSize } @@ -992,7 +992,7 @@ var ErrCannotLoadFeedManifest = errors.New("Cannot load feed manifest") // ErrNotAFeedManifest is returned when the address provided returned something other than a valid manifest var ErrNotAFeedManifest = errors.New("Not a feed manifest") -// ResolveFeedManifest retrieves the Feed manifest for the given address, and returns the referenced Feed. +// ResolveFeedManifest retrieves the Swarm feed manifest for the given address, and returns the referenced Feed. func (a *API) ResolveFeedManifest(ctx context.Context, addr storage.Address) (*feeds.Feed, error) { trie, err := loadManifest(ctx, a.fileStore, addr, nil, NOOPDecrypt) if err != nil { @@ -1007,15 +1007,15 @@ func (a *API) ResolveFeedManifest(ctx context.Context, addr storage.Address) (*f return entry.Feed, nil } -// ErrCannotResolveFeedURI is returned when the ENS resolver is not able to translate a name to a Feed +// ErrCannotResolveFeedURI is returned when the ENS resolver is not able to translate a name to a Swarm feed var ErrCannotResolveFeedURI = errors.New("Cannot resolve Feed URI") // ErrCannotResolveFeed is returned when values provided are not enough or invalid to recreate a -// Feed out of them. +// feed out of them. var ErrCannotResolveFeed = errors.New("Cannot resolve Feed") -// ResolveFeed attempts to extract Feed information out of the manifest, if provided -// If not, it attempts to extract the Feed out of a set of key-value pairs +// ResolveFeed attempts to extract feed information out of the manifest, if provided +// If not, it attempts to extract the feed out of a set of key-value pairs func (a *API) ResolveFeed(ctx context.Context, uri *URI, values feeds.Values) (*feeds.Feed, error) { var feed *feeds.Feed var err error @@ -1029,7 +1029,7 @@ func (a *API) ResolveFeed(ctx context.Context, uri *URI, values feeds.Values) (* } } - // get the Feed from the manifest + // get the Swarm feed from the manifest feed, err = a.ResolveFeedManifest(ctx, manifestAddr) if err != nil { return nil, err diff --git a/swarm/api/client/client.go b/swarm/api/client/client.go index 6b4614581..ac218e6a7 100644 --- a/swarm/api/client/client.go +++ b/swarm/api/client/client.go @@ -604,9 +604,9 @@ func (c *Client) MultipartUpload(hash string, uploader Uploader) (string, error) // ErrNoFeedUpdatesFound is returned when Swarm cannot find updates of the given feed var ErrNoFeedUpdatesFound = errors.New("No updates found for this feed") -// CreateFeedWithManifest creates a Feed Manifest, initializing it with the provided +// CreateFeedWithManifest creates a feed manifest, initializing it with the provided // data -// Returns the resulting Feed Manifest address that you can use to include in an ENS Resolver (setContent) +// Returns the resulting feed manifest address that you can use to include in an ENS Resolver (setContent) // or reference future updates (Client.UpdateFeed) func (c *Client) CreateFeedWithManifest(request *feeds.Request) (string, error) { responseStream, err := c.updateFeed(request, true) @@ -669,7 +669,7 @@ func (c *Client) QueryFeed(query *feeds.Query, manifestAddressOrDomain string) ( // queryFeed returns a byte stream with the raw content of the feed update // manifestAddressOrDomain is the address you obtained in CreateFeedWithManifest or an ENS domain whose Resolver // points to that address -// meta set to true will instruct the node return Feed metainformation instead +// meta set to true will instruct the node return feed metainformation instead func (c *Client) queryFeed(query *feeds.Query, manifestAddressOrDomain string, meta bool) (io.ReadCloser, error) { URL, err := url.Parse(c.Gateway) if err != nil { @@ -706,7 +706,7 @@ func (c *Client) queryFeed(query *feeds.Query, manifestAddressOrDomain string, m return res.Body, nil } -// GetFeedRequest returns a structure that describes the referenced Feed status +// GetFeedRequest returns a structure that describes the referenced feed status // manifestAddressOrDomain is the address you obtained in CreateFeedWithManifest or an ENS domain whose Resolver // points to that address func (c *Client) GetFeedRequest(query *feeds.Query, manifestAddressOrDomain string) (*feeds.Request, error) { diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go index 84e06d09f..0cfeb1f22 100644 --- a/swarm/api/http/server.go +++ b/swarm/api/http/server.go @@ -518,7 +518,7 @@ func (s *Server) HandlePostFeed(w http.ResponseWriter, r *http.Request) { return } // the key to the manifest will be passed back to the client - // the client can access the Feed directly through its Feed member + // the client can access the feed directly through its Feed member // the manifest key can be set as content in the resolver of the ENS name outdata, err := json.Marshal(m) if err != nil { @@ -531,7 +531,7 @@ func (s *Server) HandlePostFeed(w http.ResponseWriter, r *http.Request) { } } -// HandleGetFeed retrieves Swarm Feeds updates: +// HandleGetFeed retrieves Swarm feeds updates: // bzz-feed://<manifest address or ENS name> - get latest feed update, given a manifest address // - or - // specify user + topic (optional), subtopic name (optional) directly, without manifest: diff --git a/swarm/api/http/server_test.go b/swarm/api/http/server_test.go index 16813cab5..4ab99b209 100644 --- a/swarm/api/http/server_test.go +++ b/swarm/api/http/server_test.go @@ -165,7 +165,7 @@ func TestBzzFeedMultihash(t *testing.T) { } } -// Test Swarm Feeds using the raw update methods +// Test Swarm feeds using the raw update methods func TestBzzFeed(t *testing.T) { srv := testutil.NewTestSwarmServer(t, serverFunc, nil) signer, _ := newTestSigner() @@ -305,7 +305,7 @@ func TestBzzFeed(t *testing.T) { srv.CurrentTime++ log.Info("update 2") - // 1.- get metadata about this Feed + // 1.- get metadata about this feed testBzzResUrl = fmt.Sprintf("%s/bzz-feed:/%s/", srv.URL, correctManifestAddrHex) resp, err = http.Get(testBzzResUrl + "?meta=1") if err != nil { diff --git a/swarm/api/manifest.go b/swarm/api/manifest.go index 9ac3214a5..e45ae85c4 100644 --- a/swarm/api/manifest.go +++ b/swarm/api/manifest.go @@ -80,7 +80,7 @@ func (a *API) NewManifest(ctx context.Context, toEncrypt bool) (storage.Address, return addr, err } -// Manifest hack for supporting Feeds 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) NewFeedManifest(ctx context.Context, feed *feeds.Feed) (storage.Address, error) { var manifest Manifest |