aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/api/client
diff options
context:
space:
mode:
authorJavier Peletier <jm@epiclabs.io>2018-10-03 15:15:17 +0800
committerJavier Peletier <jm@epiclabs.io>2018-10-03 15:15:28 +0800
commitde01178c18766b9f744acc94fe2b96804f998e40 (patch)
treeb572a263ff660bd5ded343a5253f86f1f1145e46 /swarm/api/client
parent696bc9b01ce0ed3347fa1bd64460ccc08091e90a (diff)
downloadgo-tangerine-de01178c18766b9f744acc94fe2b96804f998e40.tar
go-tangerine-de01178c18766b9f744acc94fe2b96804f998e40.tar.gz
go-tangerine-de01178c18766b9f744acc94fe2b96804f998e40.tar.bz2
go-tangerine-de01178c18766b9f744acc94fe2b96804f998e40.tar.lz
go-tangerine-de01178c18766b9f744acc94fe2b96804f998e40.tar.xz
go-tangerine-de01178c18766b9f744acc94fe2b96804f998e40.tar.zst
go-tangerine-de01178c18766b9f744acc94fe2b96804f998e40.zip
swarm/storage/feed: Renamed package
Diffstat (limited to 'swarm/api/client')
-rw-r--r--swarm/api/client/client.go16
-rw-r--r--swarm/api/client/client_test.go20
2 files changed, 18 insertions, 18 deletions
diff --git a/swarm/api/client/client.go b/swarm/api/client/client.go
index ac218e6a7..d9837ca73 100644
--- a/swarm/api/client/client.go
+++ b/swarm/api/client/client.go
@@ -35,7 +35,7 @@ import (
"strings"
"github.com/ethereum/go-ethereum/swarm/api"
- "github.com/ethereum/go-ethereum/swarm/storage/feeds"
+ "github.com/ethereum/go-ethereum/swarm/storage/feed"
)
var (
@@ -608,7 +608,7 @@ var ErrNoFeedUpdatesFound = errors.New("No updates found for this feed")
// data
// 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) {
+func (c *Client) CreateFeedWithManifest(request *feed.Request) (string, error) {
responseStream, err := c.updateFeed(request, true)
if err != nil {
return "", err
@@ -628,12 +628,12 @@ func (c *Client) CreateFeedWithManifest(request *feeds.Request) (string, error)
}
// UpdateFeed allows you to set a new version of your content
-func (c *Client) UpdateFeed(request *feeds.Request) error {
+func (c *Client) UpdateFeed(request *feed.Request) error {
_, err := c.updateFeed(request, false)
return err
}
-func (c *Client) updateFeed(request *feeds.Request, createManifest bool) (io.ReadCloser, error) {
+func (c *Client) updateFeed(request *feed.Request, createManifest bool) (io.ReadCloser, error) {
URL, err := url.Parse(c.Gateway)
if err != nil {
return nil, err
@@ -662,7 +662,7 @@ func (c *Client) updateFeed(request *feeds.Request, createManifest bool) (io.Rea
// 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
-func (c *Client) QueryFeed(query *feeds.Query, manifestAddressOrDomain string) (io.ReadCloser, error) {
+func (c *Client) QueryFeed(query *feed.Query, manifestAddressOrDomain string) (io.ReadCloser, error) {
return c.queryFeed(query, manifestAddressOrDomain, false)
}
@@ -670,7 +670,7 @@ func (c *Client) QueryFeed(query *feeds.Query, manifestAddressOrDomain string) (
// 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
-func (c *Client) queryFeed(query *feeds.Query, manifestAddressOrDomain string, meta bool) (io.ReadCloser, error) {
+func (c *Client) queryFeed(query *feed.Query, manifestAddressOrDomain string, meta bool) (io.ReadCloser, error) {
URL, err := url.Parse(c.Gateway)
if err != nil {
return nil, err
@@ -709,7 +709,7 @@ func (c *Client) queryFeed(query *feeds.Query, manifestAddressOrDomain string, m
// 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) {
+func (c *Client) GetFeedRequest(query *feed.Query, manifestAddressOrDomain string) (*feed.Request, error) {
responseStream, err := c.queryFeed(query, manifestAddressOrDomain, true)
if err != nil {
@@ -722,7 +722,7 @@ func (c *Client) GetFeedRequest(query *feeds.Query, manifestAddressOrDomain stri
return nil, err
}
- var metadata feeds.Request
+ var metadata feed.Request
if err := metadata.UnmarshalJSON(body); err != nil {
return nil, err
}
diff --git a/swarm/api/client/client_test.go b/swarm/api/client/client_test.go
index 2aecdb299..03c6cbb28 100644
--- a/swarm/api/client/client_test.go
+++ b/swarm/api/client/client_test.go
@@ -25,14 +25,14 @@ import (
"sort"
"testing"
- "github.com/ethereum/go-ethereum/swarm/storage/feeds/lookup"
+ "github.com/ethereum/go-ethereum/swarm/storage/feed/lookup"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/swarm/api"
swarmhttp "github.com/ethereum/go-ethereum/swarm/api/http"
"github.com/ethereum/go-ethereum/swarm/multihash"
- "github.com/ethereum/go-ethereum/swarm/storage/feeds"
+ "github.com/ethereum/go-ethereum/swarm/storage/feed"
"github.com/ethereum/go-ethereum/swarm/testutil"
)
@@ -361,12 +361,12 @@ func TestClientMultipartUpload(t *testing.T) {
}
}
-func newTestSigner() (*feeds.GenericSigner, error) {
+func newTestSigner() (*feed.GenericSigner, error) {
privKey, err := crypto.HexToECDSA("deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef")
if err != nil {
return nil, err
}
- return feeds.NewGenericSigner(privKey), nil
+ return feed.NewGenericSigner(privKey), nil
}
// test the transparent resolving of multihash feed updates with bzz:// scheme
@@ -394,9 +394,9 @@ func TestClientCreateFeedMultihash(t *testing.T) {
mh := multihash.ToMultihash(s)
// our feed topic
- topic, _ := feeds.NewTopic("foo.eth", nil)
+ topic, _ := feed.NewTopic("foo.eth", nil)
- createRequest := feeds.NewFirstRequest(topic)
+ createRequest := feed.NewFirstRequest(topic)
createRequest.SetData(mh)
if err := createRequest.Sign(signer); err != nil {
@@ -448,8 +448,8 @@ func TestClientCreateUpdateFeed(t *testing.T) {
databytes := []byte("En un lugar de La Mancha, de cuyo nombre no quiero acordarme...")
// our feed topic name
- topic, _ := feeds.NewTopic("El Quijote", nil)
- createRequest := feeds.NewFirstRequest(topic)
+ topic, _ := feed.NewTopic("El Quijote", nil)
+ createRequest := feed.NewFirstRequest(topic)
createRequest.SetData(databytes)
if err := createRequest.Sign(signer); err != nil {
@@ -508,12 +508,12 @@ func TestClientCreateUpdateFeed(t *testing.T) {
// now try retrieving feed updates without a manifest
- fd := &feeds.Feed{
+ fd := &feed.Feed{
Topic: topic,
User: signer.Address(),
}
- lookupParams := feeds.NewQueryLatest(fd, lookup.NoClue)
+ lookupParams := feed.NewQueryLatest(fd, lookup.NoClue)
reader, err = client.QueryFeed(lookupParams, "")
if err != nil {
t.Fatalf("Error retrieving feed updates: %s", err)