aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/swarm.go
diff options
context:
space:
mode:
authorLewis Marshall <lewis@lmars.net>2017-04-05 06:20:07 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-04-05 06:20:07 +0800
commitb319f027a0be232a9cb307336b0349b36737c7f1 (patch)
treea17c7dc775c270aea9acdabc8e13292b3c2ae958 /swarm/swarm.go
parent09777952ee476ff80d4b6e63b5041ff5ca0e441b (diff)
downloaddexon-b319f027a0be232a9cb307336b0349b36737c7f1.tar.gz
dexon-b319f027a0be232a9cb307336b0349b36737c7f1.tar.zst
dexon-b319f027a0be232a9cb307336b0349b36737c7f1.zip
cmd/swarm, swarm/api/client: add HTTP API client and 'swarm ls' command (#3742)
This adds a swarm ls command which lists files and directories stored in a manifest. Rather than listing all files, it uses "directory prefixes" in case there are a lot of files in a manifest but you just want to traverse it. This also includes some refactoring to the tests and the introduction of a swarm/api/client package to make things easier to test.
Diffstat (limited to 'swarm/swarm.go')
-rw-r--r--swarm/swarm.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/swarm/swarm.go b/swarm/swarm.go
index 0ce31bcad..add28d205 100644
--- a/swarm/swarm.go
+++ b/swarm/swarm.go
@@ -195,7 +195,10 @@ func (self *Swarm) Start(net *p2p.Server) error {
// start swarm http proxy server
if self.config.Port != "" {
addr := ":" + self.config.Port
- go httpapi.StartHttpServer(self.api, &httpapi.Server{Addr: addr, CorsString: self.corsString})
+ go httpapi.StartHttpServer(self.api, &httpapi.ServerConfig{
+ Addr: addr,
+ CorsString: self.corsString,
+ })
}
log.Debug(fmt.Sprintf("Swarm http proxy started on port: %v", self.config.Port))