2016-07-01 03:18:55 +00:00
|
|
|
package core
|
|
|
|
|
2016-09-11 04:57:54 +00:00
|
|
|
type Ricochet struct {
|
|
|
|
Config *Config
|
|
|
|
Network *Network
|
2016-09-11 04:35:03 +00:00
|
|
|
Protocol *Protocol
|
2016-09-11 04:57:54 +00:00
|
|
|
Identity *Identity
|
|
|
|
}
|
|
|
|
|
|
|
|
func (core *Ricochet) Init(conf *Config) error {
|
|
|
|
var err error
|
|
|
|
core.Config = conf
|
|
|
|
core.Network = CreateNetwork()
|
2016-09-11 04:35:03 +00:00
|
|
|
core.Protocol = CreateProtocol(core)
|
2016-09-11 04:57:54 +00:00
|
|
|
core.Identity, err = CreateIdentity(core)
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
2016-07-01 03:18:55 +00:00
|
|
|
}
|