Documentation ¶
Index ¶
Constants ¶
const ENVELOPES_BUFFERSIZE = 100
const PUBSUB_MESSAGES_BUFFERSIZE = 32
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Actor ¶
type Actor struct { Entity *entity.Entity Keyset set.Keyset // Envelopes are here. Messages comes to the entity. // So Entity.Messages Envelopes chan *msg.Envelope }
An actor is just an entity with a keyset.
func GetOrCreate ¶
// Get an entity from the global map. // The input is a full did string. If one is created it will have no Nick. // The function should do the required lookups to get the nick. // And verify the entity.
func Init ¶ added in v0.4.0
func Init() *Actor
Initialise an actor or panic. This is a common sugar function to create an actor from the keyset and set the DID Document. Meant to be called from most main's. Panics if the actor is not valid.
func New ¶
Create a new entity from a DID and a Keyset. We need both. The DID is to verify the entity, and the keyset is to create the DID Document.
func (*Actor) HandleIncomingEnvelopes ¶ added in v0.3.0
Lets actor listen for incoming envelopes and open them, if possible. The actor can decrypt the messages, which are then sent to the intended recipient. This is a little extra step., but it makes the design simpler and easier to understand /methinks. Sent the messages to the message channel in the input. Then you can handle the messages in the UI or wherever you want to handle them and you know they were private messages.
func (*Actor) HelloWorld ¶ added in v0.4.0
type ActorConfig ¶ added in v0.4.0
type ActorConfig struct { Actor config.ActorConfig `yaml:"actor"` API config.APIConfig `yaml:"api"` DB config.DBConfig `yaml:"db"` HTTP config.HTTPConfig `yaml:"http"` Log config.LogConfig `yaml:"log"` P2P config.P2PConfig `yaml:"p2p"` }
func Config ¶ added in v0.4.0
func Config() ActorConfig
This is an all-inclusive configuration function that sets up the configuration for the actor. flags and everything. It is used in the main function of simple actors programmes. It also parses the common flags.
func (*ActorConfig) MarshalToYAML ¶ added in v0.4.0
func (c *ActorConfig) MarshalToYAML() ([]byte, error)
func (*ActorConfig) Print ¶ added in v0.4.0
func (c *ActorConfig) Print()
func (*ActorConfig) Save ¶ added in v0.4.0
func (c *ActorConfig) Save() error