This commit is contained in:
Sarah Jamie Lewis 2018-06-08 14:54:31 -07:00
parent 5a94afa0f7
commit e382c8eb69
35 changed files with 85 additions and 85 deletions

View File

@ -33,11 +33,11 @@ can check coverage `with go test --cover github.com/s-rah/go-ricochet`
Format your code (the path might be slightly different): Format your code (the path might be slightly different):
* `gofmt -l=true -s -w src/github.com/s-rah/go-ricochet/` * `gofmt -l=true -s -w src/git.openprivacy.ca/openprivacy/libricochet-go/`
Run the following commands, and address any issues which arise: Run the following commands, and address any issues which arise:
* `go vet github.com/s-rah/go-ricochet/...` * `go vet git.openprivacy.ca/openprivacy/libricochet-go/...`
* `/golint application/ channels/ connection/ examples/ identity/ policies/ testing/ utils` * `/golint application/ channels/ connection/ examples/ identity/ policies/ testing/ utils`
## 4. Code Review ## 4. Code Review

View File

@ -1,6 +1,6 @@
# GoRicochet [![Build Status](https://travis-ci.org/s-rah/go-ricochet.svg?branch=master)](https://travis-ci.org/s-rah/go-ricochet) [![Go Report Card](https://goreportcard.com/badge/github.com/s-rah/go-ricochet)](https://goreportcard.com/report/github.com/s-rah/go-ricochet) [![Coverage Status](https://coveralls.io/repos/github/s-rah/go-ricochet/badge.svg?branch=master)](https://coveralls.io/github/s-rah/go-ricochet?branch=master) # libricochet-go [![Build Status](https://travis-ci.org/s-rah/go-ricochet.svg?branch=master)](https://travis-ci.org/s-rah/go-ricochet) [![Go Report Card](https://goreportcard.com/badge/github.com/s-rah/go-ricochet)](https://goreportcard.com/report/github.com/s-rah/go-ricochet) [![Coverage Status](https://coveralls.io/repos/github/s-rah/go-ricochet/badge.svg?branch=master)](https://coveralls.io/github/s-rah/go-ricochet?branch=master)
GoRicochet is an experimental implementation of the [Ricochet Protocol](https://ricochet.im) libricochet-go is an experimental implementation of the [Ricochet Protocol](https://ricochet.im)
in Go. in Go.
## Features ## Features
@ -15,8 +15,8 @@ Below is a simple echo bot, which responds to any chat message. You can also fin
package main package main
import ( import (
"github.com/s-rah/go-ricochet/application" "git.openprivacy.ca/openprivacy/libricochet-go/application"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"log" "log"
"time" "time"
) )

View File

@ -2,10 +2,10 @@ package application
import ( import (
"crypto/rsa" "crypto/rsa"
"github.com/s-rah/go-ricochet" "git.openprivacy.ca/openprivacy/libricochet-go"
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/connection" "git.openprivacy.ca/openprivacy/libricochet-go/connection"
"github.com/s-rah/go-ricochet/identity" "git.openprivacy.ca/openprivacy/libricochet-go/identity"
"log" "log"
"net" "net"
"sync" "sync"

View File

@ -1,8 +1,8 @@
package application package application
import ( import (
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/connection" "git.openprivacy.ca/openprivacy/libricochet-go/connection"
) )
// ApplicationInstance is a concrete instance of a ricochet application, encapsulating a connection // ApplicationInstance is a concrete instance of a ricochet application, encapsulating a connection

View File

@ -1,9 +1,9 @@
package main package main
import ( import (
"github.com/s-rah/go-ricochet/application" "git.openprivacy.ca/openprivacy/libricochet-go/application"
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"log" "log"
"time" "time"
) )
@ -84,7 +84,7 @@ func main() {
} }
}) })
echobot.Init(pk, af, new(application.AcceptAllContactManager)) echobot.Init("echobot", pk, af, new(application.AcceptAllContactManager))
log.Printf("echobot listening on %s", l.Addr().String()) log.Printf("echobot listening on %s", l.Addr().String())
echobot.Run(l) echobot.Run(l)
} }

View File

@ -2,9 +2,9 @@ package channels
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/chat" "git.openprivacy.ca/openprivacy/libricochet-go/wire/chat"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"time" "time"
) )

View File

@ -2,9 +2,9 @@ package channels
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/chat" "git.openprivacy.ca/openprivacy/libricochet-go/wire/chat"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"testing" "testing"
"time" "time"
) )

View File

@ -2,9 +2,9 @@ package channels
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/contact" "git.openprivacy.ca/openprivacy/libricochet-go/wire/contact"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
) )
// Defining Versions // Defining Versions

View File

@ -2,9 +2,9 @@ package channels
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/contact" "git.openprivacy.ca/openprivacy/libricochet-go/wire/contact"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"testing" "testing"
) )

View File

@ -1,7 +1,7 @@
package channels package channels
import ( import (
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
) )
// Handler reacts to low-level events on a protocol channel. There // Handler reacts to low-level events on a protocol channel. There

View File

@ -8,10 +8,10 @@ import (
"crypto/sha256" "crypto/sha256"
"encoding/asn1" "encoding/asn1"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/identity" "git.openprivacy.ca/openprivacy/libricochet-go/identity"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/auth" "git.openprivacy.ca/openprivacy/libricochet-go/wire/auth"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"io" "io"
) )

View File

@ -4,9 +4,9 @@ import (
"bytes" "bytes"
"crypto/rsa" "crypto/rsa"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/identity" "git.openprivacy.ca/openprivacy/libricochet-go/identity"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"testing" "testing"
) )

View File

@ -1,7 +1,7 @@
package connection package connection
import ( import (
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
) )
// AuthorizationManager helps keep track of permissions for a connection // AuthorizationManager helps keep track of permissions for a connection

View File

@ -1,8 +1,8 @@
package connection package connection
import ( import (
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
) )
// AutoConnectionHandler implements the ConnectionHandler interface on behalf of // AutoConnectionHandler implements the ConnectionHandler interface on behalf of

View File

@ -2,9 +2,9 @@ package connection
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"testing" "testing"
) )

View File

@ -1,8 +1,8 @@
package connection package connection
import ( import (
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"sync" "sync"
) )

View File

@ -1,7 +1,7 @@
package connection package connection
import ( import (
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"testing" "testing"
) )

View File

@ -4,9 +4,9 @@ import (
"context" "context"
"fmt" "fmt"
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"io" "io"
"log" "log"
"sync" "sync"

View File

@ -2,8 +2,8 @@ package connection
import ( import (
"crypto/rsa" "crypto/rsa"
"github.com/s-rah/go-ricochet/identity" "git.openprivacy.ca/openprivacy/libricochet-go/identity"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"net" "net"
"testing" "testing"
"time" "time"

View File

@ -2,8 +2,8 @@ package connection
import ( import (
"errors" "errors"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
) )
// ControlChannel encapsulates logic for the control channel processing // ControlChannel encapsulates logic for the control channel processing

View File

@ -2,9 +2,9 @@ package connection
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"testing" "testing"
) )

View File

@ -1,7 +1,7 @@
package connection package connection
import ( import (
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
) )
// Handler reacts to low-level events on a protocol connection. // Handler reacts to low-level events on a protocol connection.

View File

@ -2,10 +2,10 @@ package connection
import ( import (
"crypto/rsa" "crypto/rsa"
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/identity" "git.openprivacy.ca/openprivacy/libricochet-go/identity"
"github.com/s-rah/go-ricochet/policies" "git.openprivacy.ca/openprivacy/libricochet-go/policies"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"sync" "sync"
) )

View File

@ -1,10 +1,10 @@
package connection package connection
import ( import (
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/identity" "git.openprivacy.ca/openprivacy/libricochet-go/identity"
"github.com/s-rah/go-ricochet/policies" "git.openprivacy.ca/openprivacy/libricochet-go/policies"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"sync" "sync"
) )

View File

@ -1,11 +1,11 @@
package main package main
import ( import (
"github.com/s-rah/go-ricochet" "git.openprivacy.ca/openprivacy/libricochet-go"
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/connection" "git.openprivacy.ca/openprivacy/libricochet-go/connection"
"github.com/s-rah/go-ricochet/identity" "git.openprivacy.ca/openprivacy/libricochet-go/identity"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"log" "log"
"time" "time"
) )

View File

@ -4,7 +4,7 @@ import (
"crypto" "crypto"
"crypto/rsa" "crypto/rsa"
"encoding/asn1" "encoding/asn1"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
) )
// Identity is an encapsulation of Name, PrivateKey and other features // Identity is an encapsulation of Name, PrivateKey and other features

View File

@ -1,7 +1,7 @@
package goricochet package goricochet
import ( import (
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"io" "io"
"net" "net"
"testing" "testing"

View File

@ -1,7 +1,7 @@
package goricochet package goricochet
import ( import (
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"net" "net"
"testing" "testing"
"time" "time"

View File

@ -1,7 +1,7 @@
package policies package policies
import ( import (
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"time" "time"
) )

View File

@ -1,8 +1,8 @@
package goricochet package goricochet
import ( import (
"github.com/s-rah/go-ricochet/connection" "git.openprivacy.ca/openprivacy/libricochet-go/connection"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"io" "io"
"net" "net"
) )

View File

@ -2,9 +2,9 @@ package testing
import ( import (
"fmt" "fmt"
"github.com/s-rah/go-ricochet/application" "git.openprivacy.ca/openprivacy/libricochet-go/application"
"github.com/s-rah/go-ricochet/channels" "git.openprivacy.ca/openprivacy/libricochet-go/channels"
"github.com/s-rah/go-ricochet/utils" "git.openprivacy.ca/openprivacy/libricochet-go/utils"
"log" "log"
"runtime" "runtime"
"strconv" "strconv"

View File

@ -2,10 +2,10 @@ package utils
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/wire/auth" "git.openprivacy.ca/openprivacy/libricochet-go/wire/auth"
"github.com/s-rah/go-ricochet/wire/chat" "git.openprivacy.ca/openprivacy/libricochet-go/wire/chat"
"github.com/s-rah/go-ricochet/wire/contact" "git.openprivacy.ca/openprivacy/libricochet-go/wire/contact"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
) )
// MessageBuilder allows a client to construct specific data packets for the // MessageBuilder allows a client to construct specific data packets for the

View File

@ -2,7 +2,7 @@ package utils
import ( import (
"github.com/golang/protobuf/proto" "github.com/golang/protobuf/proto"
"github.com/s-rah/go-ricochet/wire/control" "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
"testing" "testing"
) )

View File

@ -18,7 +18,7 @@ package Protocol_Data_AuthHiddenService
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import fmt "fmt" import fmt "fmt"
import math "math" import math "math"
import Protocol_Data_Control "github.com/s-rah/go-ricochet/wire/control" import Protocol_Data_Control "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal

View File

@ -17,7 +17,7 @@ package Protocol_Data_ContactRequest
import proto "github.com/golang/protobuf/proto" import proto "github.com/golang/protobuf/proto"
import fmt "fmt" import fmt "fmt"
import math "math" import math "math"
import Protocol_Data_Control "github.com/s-rah/go-ricochet/wire/control" import Protocol_Data_Control "git.openprivacy.ca/openprivacy/libricochet-go/wire/control"
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal