diff options
Diffstat (limited to 'vendor/github.com/cretz/bine/control/cmd_hiddenservice.go')
-rw-r--r-- | vendor/github.com/cretz/bine/control/cmd_hiddenservice.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/vendor/github.com/cretz/bine/control/cmd_hiddenservice.go b/vendor/github.com/cretz/bine/control/cmd_hiddenservice.go new file mode 100644 index 0000000..ab52142 --- /dev/null +++ b/vendor/github.com/cretz/bine/control/cmd_hiddenservice.go @@ -0,0 +1,23 @@ +package control + +// GetHiddenServiceDescriptorAsync invokes HSFETCH. +func (c *Conn) GetHiddenServiceDescriptorAsync(address string, server string) error { + cmd := "HSFETCH " + address + if server != "" { + cmd += " SERVER=" + server + } + return c.sendRequestIgnoreResponse(cmd) +} + +// PostHiddenServiceDescriptorAsync invokes HSPOST. +func (c *Conn) PostHiddenServiceDescriptorAsync(desc string, servers []string, address string) error { + cmd := "+HSPOST" + for _, server := range servers { + cmd += " SERVER=" + server + } + if address != "" { + cmd += "HSADDRESS=" + address + } + cmd += "\r\n" + desc + "\r\n." + return c.sendRequestIgnoreResponse(cmd) +} |