try and fix go mod
This commit is contained in:
@ -19,10 +19,16 @@ func (c *Client) AcceptI2P() (net.Conn, error) {
|
||||
// Listen creates a new Client and returns a net.listener which *must* be started
|
||||
// with Accept
|
||||
func (c *Client) Listen() (net.Listener, error) {
|
||||
return c.ListenI2P(c.destination)
|
||||
}
|
||||
|
||||
// ListenI2P creates a new Client and returns a net.listener which *must* be started
|
||||
// with Accept
|
||||
func (c *Client) ListenI2P(dest string) (net.Listener, error) {
|
||||
var err error
|
||||
var id int32
|
||||
c.id = c.NewID()
|
||||
c.destination, err = c.CreateStreamSession(id, c.destination)
|
||||
c.destination, err = c.CreateStreamSession(id, dest)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -1,7 +1,9 @@
|
||||
package samkeys
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/eyedeekay/sam3/i2pkeys"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func DestToKeys(dest string) (i2pkeys.I2PKeys, error) {
|
||||
@ -11,3 +13,11 @@ func DestToKeys(dest string) (i2pkeys.I2PKeys, error) {
|
||||
}
|
||||
return i2pkeys.NewKeys(addr, dest), nil
|
||||
}
|
||||
|
||||
func KeysToDest(keys i2pkeys.I2PKeys) (string, error) {
|
||||
pksk := strings.SplitN(keys.String(), "\n", 2)
|
||||
if len(pksk) != 2 {
|
||||
return "", fmt.Errorf("Error converting from keys to destination")
|
||||
}
|
||||
return pksk[1], nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user