# README
Edge-Cloud Controller
The Edge-Cloud Controller handles all persistent state and disseminates data to the Matcher and Cloudlet-Mgr nodes.
Persistent state is primarily inserted by User-driven API calls, i.e. to Create/Update/Delete Developers, Apps, Operators, Cloudlets, etc. Persistent state is stored via an Etcd database.
Persistent state is disseminated to the Matcher and Cloudlet-Mgr nodes by the notify mechanism whenever that data changes. The Matcher and Cloudlet-Mgr nodes are not part of the Etcd Cluster. They only manage a copy of the Controller's data in memory to allow for faster decision making on that data. The Matcher and Cloudlet-Mgr may not need the full set of data managed by the Controller, so the Controller will only forward changes that are needed.
Much of the code for handling objects is boiler-plate, and is handled by auto-generated code. See the protoc-gen-gomex readme. Additionally some unit test code is also generated by the protoc-gen-test code. See the readme there as well, plus the unit test template code in the go files there.
For controller unit tests that involve an etcd back-end, either the test uses a dummy etcd backend (dummy_etcd.go), or spawns a single etcd instance (the equivalent of which can be done by running the controller with --localEtcd).
CRM State Handling
See crm_state.md