Commit 4aceb267 authored by tavit ohanian's avatar tavit ohanian

initial port

parent eb491512
Pipeline #855 passed with stages
in 37 seconds
stages:
- build
- test
variables:
BUILD_DIR: "/tmp/$CI_CONCURRENT_PROJECT_ID"
before_script:
- mkdir -p $BUILD_DIR/src
- cd $BUILD_DIR/src
- if [ -d $CI_PROJECT_DIR ]
- then
- echo "soft link $CI_PROJECT_DIR exists"
- else
- echo "creating soft link $CI_PROJECT_DIR"
- ln -s $CI_PROJECT_DIR
- fi
- cd $CI_PROJECT_DIR
build:
stage: build
tags:
- testing
script:
- echo $CI_JOB_STAGE
- go build
test:
stage: test
tags:
- testing
script:
- echo $CI_JOB_STAGE
- go test -cover
coverage: '/coverage: \d+.\d+% of statements/'
......@@ -10,7 +10,7 @@ Basic Use:
import (
"bytes"
"strings"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
// construct from a string (err signals parse failure)
......
......@@ -12,7 +12,7 @@ Learn more here: https://github.com/multiformats/multiaddr
Multiaddrs have both a binary and string representation.
import ma "github.com/multiformats/go-multiaddr"
import ma "gitlab.dms3.io/mf/go-multiaddr"
addr, err := ma.NewMultiaddr("/ip4/1.2.3.4/tcp/80")
// err non-nil when parsing failed.
......
......@@ -7,7 +7,7 @@ import (
"os"
"strings"
maddr "github.com/multiformats/go-multiaddr"
maddr "gitlab.dms3.io/mf/go-multiaddr"
)
var (
......
......@@ -7,7 +7,7 @@ import (
"runtime"
"strings"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
var errIncorrectNetAddr = fmt.Errorf("incorrect network addr conversion")
......
......@@ -5,7 +5,7 @@ import (
"runtime"
"testing"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
type GenFunc func() (ma.Multiaddr, error)
......
......@@ -3,7 +3,7 @@ package manet
import (
"net"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
// Loopback Addresses
......
// Package manet provides Multiaddr
// (https://github.com/multiformats/go-multiaddr) specific versions of common
// (https://gitlab.dms3.io/mf/go-multiaddr) specific versions of common
// functions in Go's standard `net` package. This means wrappers of standard
// net symbols like `net.Dial` and `net.Listen`, as well as conversion to
// and from `net.Addr`.
......@@ -10,7 +10,7 @@ import (
"fmt"
"net"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
// Conn is the equivalent of a net.Conn object. It is the
......
......@@ -11,7 +11,7 @@ import (
"testing"
"time"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
func newMultiaddr(t *testing.T, m string) ma.Multiaddr {
......
......@@ -3,7 +3,7 @@ package manet
import (
"net"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
// Private4 and Private6 are well-known private networks
......
......@@ -3,7 +3,7 @@ package manet
import (
"testing"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
func TestIsPublicAddr(t *testing.T) {
......
......@@ -5,7 +5,7 @@ import (
"net"
"sync"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
// FromNetAddrFunc is a generic function which converts a net.Addr to Multiaddress
......
......@@ -4,7 +4,7 @@ import (
"net"
"testing"
ma "github.com/multiformats/go-multiaddr"
ma "gitlab.dms3.io/mf/go-multiaddr"
)
func TestRegisterFrom(t *testing.T) {
......
......@@ -21,6 +21,7 @@ const (
P_UNIX = 0x0190
P_P2P = 0x01A5
P_IPFS = 0x01A5 // alias for backwards compatibility
P_DMS3 = 0x01A5 // temprary alias, codec to be reserved later
P_HTTP = 0x01E0
P_HTTPS = 0x01BB // deprecated alias for /tls/http
P_ONION = 0x01BC // also for backwards compatibility
......@@ -260,4 +261,5 @@ func init() {
// explicitly set both of these
protocolsByName["p2p"] = protoP2P
protocolsByName["ipfs"] = protoP2P
protocolsByName["dms3"] = protoP2P
}
......@@ -10,8 +10,8 @@ import (
"strconv"
"strings"
"github.com/ipfs/go-cid"
mh "github.com/multiformats/go-multihash"
"gitlab.dms3.io/dms3/public/go-cid"
)
type Transcoder interface {
......@@ -311,7 +311,7 @@ func p2pStB(s string) ([]byte, error) {
return nil, fmt.Errorf("failed to parse p2p addr: %s %s", s, err)
}
if ty := c.Type(); ty == cid.Libp2pKey {
if ty := c.Type(); ty == cid.P2pKey {
return c.Hash(), nil
} else {
return nil, fmt.Errorf("failed to parse p2p addr: %s has the invalid codec %d", s, ty)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment