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