index.go 216 Bytes
Newer Older
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
1 2 3 4 5 6
package multiaddr

type Multiaddr struct {
  Bytes []byte
}

Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
7 8 9 10 11 12
func NewString(s string) (*Multiaddr, error) {
  b, err := StringToBytes(s)
  if err != nil {
    return nil, err
  }
  return &Multiaddr{Bytes: b}, nil
Juan Batiz-Benet's avatar
Juan Batiz-Benet committed
13
}