Documentation ¶
Overview ¶
This package wraps the meekod functionality into a Daemon struct that can be imported and started inside of any Go program.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrTerminated = errors.New("daemon already terminated")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Verbose bool Broker *struct { Endpoints *struct { Logging *struct { ZeroMQ string `yaml:"zeromq"` } `yaml:"logging"` PubSub *struct { ZeroMQ *struct { Router string Pub string } `yaml:"zeromq"` } `yaml:"pubsub"` RPC *struct { ZeroMQ string `yaml:"zeromq"` WebSocket *struct { Address string Token string HeartbeatPeriod time.Duration `yaml:"heartbeat_period"` } `yaml:"websocket"` } `yaml:"rpc"` } } Supervisor *struct { Workspace string MongoDbUrl string `yaml:"mongodb_url"` Token string } }
func ReadConfigFile ¶
func (*Config) PopulateEnviron ¶
PopulateEnviron exports the values from the config file as environment variables so that the values are reachable from the agents.
This is not super clean solution, there is space for rethinking this.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
func NewFromConfigAsBytes ¶
func (*Daemon) Monitor ¶
func (daemon *Daemon) Monitor(monitorCh chan<- *broker.EndpointCrashReport)
func (*Daemon) Terminate ¶
Terminate shuts the daemon down.
This method blocks until the daemon is terminated.
ErrTerminated is returned in case Terminate has already been called.
func (*Daemon) TerminateZmq ¶
TerminateZmq calls Terminate(), then zmq.Term().
func (*Daemon) Terminated ¶
func (daemon *Daemon) Terminated() <-chan struct{}
Terminated returns a channel that is closed when the daemon is terminated.
type Options ¶
type Options struct { // Do not start the agent supervisor. DisableSupervisor bool // Disable the inter-process service endpoints. // These are used to plug the local agents into the platform. // Can be useful in case only WebSocket is being used. DisableLocalEndpoints bool }
Options can be used to define what parts of meekod will be started. This can be used to align meekod for a couple of scenarios.