try and fix go mod

This commit is contained in:
idk
2019-07-12 16:46:54 -04:00
parent d8c0f81c78
commit 5fd5f21be6
3 changed files with 18 additions and 2 deletions

View File

@ -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
}

View File

@ -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
}

2
go.mod
View File

@ -1,3 +1,3 @@
module github.com/eyedeekay/gosam
module github.com/eyedeekay/goSam
require github.com/eyedeekay/sam3 v0.0.0-20190613034117-99ad6522ebe3