name update
This commit is contained in:
parent
52ce7615c3
commit
0d080e4332
|
@ -23,14 +23,14 @@ type RicochetApplication struct {
|
|||
v3identity identity.Identity
|
||||
name string
|
||||
ls connectivity.ListenService
|
||||
mn connectivity.Mixnet
|
||||
mn connectivity.ACN
|
||||
instances []*ApplicationInstance
|
||||
lock sync.Mutex
|
||||
aif ApplicationInstanceFactory
|
||||
}
|
||||
|
||||
// Init initializes the underlying RicochetApplication datastructure, making it ready for use
|
||||
func (ra *RicochetApplication) Init(mn connectivity.Mixnet, name string, v3identity identity.Identity, af ApplicationInstanceFactory, cm ContactManagerInterface) {
|
||||
func (ra *RicochetApplication) Init(mn connectivity.ACN, name string, v3identity identity.Identity, af ApplicationInstanceFactory, cm ContactManagerInterface) {
|
||||
ra.mn = mn
|
||||
ra.name = name
|
||||
ra.v3identity = v3identity
|
||||
|
|
|
@ -114,7 +114,7 @@ func main() {
|
|||
time.Sleep(time.Second * 30)
|
||||
}
|
||||
|
||||
func NewAliceBot(mn connectivity.Mixnet, onion string) alicebot {
|
||||
func NewAliceBot(mn connectivity.ACN, onion string) alicebot {
|
||||
alice := alicebot{}
|
||||
alice.messages = make(map[uint32]string)
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ type ListenService interface {
|
|||
Close()
|
||||
}
|
||||
|
||||
// Mixnet is mixnet implementation wrapper that supports Open for new connections and Listen to accept connections
|
||||
type Mixnet interface {
|
||||
// ACN is Anonymous Communication Network implementation wrapper that supports Open for new connections and Listen to accept connections
|
||||
type ACN interface {
|
||||
// Open takes a hostname and returns a net.Conn to the derived endpoint
|
||||
// Open allows a client to resolve various hostnames to connections
|
||||
// The supported types are onions address are:
|
|
@ -54,7 +54,7 @@ func (lp *localProvider) Close() {
|
|||
|
||||
}
|
||||
|
||||
// LocalProvider returns a for testing use only local clearnet implementation of a Mixnet interface
|
||||
func LocalProvider() Mixnet {
|
||||
// LocalProvider returns a for testing use only local clearnet implementation of a ACN interface
|
||||
func LocalProvider() ACN {
|
||||
return &localProvider{}
|
||||
}
|
||||
|
|
|
@ -88,8 +88,8 @@ func (tp *torProvider) Close() {
|
|||
tp.t.Close()
|
||||
}
|
||||
|
||||
// StartTor creates/starts a Tor mixnet and returns a usable Mixnet object
|
||||
func StartTor(appDirectory string, bundledTorPath string) (Mixnet, error) {
|
||||
// StartTor creates/starts a Tor ACN and returns a usable ACN object
|
||||
func StartTor(appDirectory string, bundledTorPath string) (ACN, error) {
|
||||
dataDir := path.Join(appDirectory, "tor")
|
||||
os.MkdirAll(dataDir, 0700)
|
||||
|
||||
|
@ -132,7 +132,7 @@ func StartTor(appDirectory string, bundledTorPath string) (Mixnet, error) {
|
|||
return nil, errors.New("Could not connect to or start Tor that met requirments")
|
||||
}
|
||||
|
||||
func createFromExisting(controlport *control.Conn, datadir string) Mixnet {
|
||||
func createFromExisting(controlport *control.Conn, datadir string) ACN {
|
||||
t := &tor.Tor{
|
||||
Process: nil,
|
||||
Control: controlport,
|
||||
|
|
|
@ -13,7 +13,7 @@ import (
|
|||
// will be closed. This function blocks until version negotiation has completed.
|
||||
// The application should call Process() on the returned OpenConnection to continue
|
||||
// handling protocol messages.
|
||||
func Open(mn connectivity.Mixnet, remoteHostname string) (*connection.Connection, error) {
|
||||
func Open(mn connectivity.ACN, remoteHostname string) (*connection.Connection, error) {
|
||||
conn, remoteHostname, err := mn.Open(remoteHostname)
|
||||
|
||||
if err != nil {
|
||||
|
|
Reference in New Issue