Controller owns the namespace control-plane state. Concurrency contract: hashicorp RAFT invokes Snapshot from a goroutine that may run concurrently with Apply, so the RLock inside Snapshot is load-bearing, not cosmetic. Applies are serialized by RAFT (write-lock semantics); queries take the read-lo
| 98 | // semantics); queries take the read-lock. Do not remove the Snapshot |
| 99 | // RLock in a future refactor. |
| 100 | type Controller struct { |
| 101 | mu sync.RWMutex |
| 102 | namespaces map[string]*cmd.Namespace |
| 103 | logger logrus.FieldLogger |
| 104 | } |
| 105 | |
| 106 | // NewController returns an empty, ready-to-use controller. |
| 107 | func NewController(logger logrus.FieldLogger) *Controller { |
nothing calls this directly
no outgoing calls
no test coverage detected