Compile compute a view of the final state. This is what we would use to display the state in a user interface.
()
| 272 | // Compile compute a view of the final state. This is what we would use to display the state |
| 273 | // in a user interface. |
| 274 | func (pc ProjectConfig) Compile() *Snapshot { |
| 275 | // Note: this would benefit from caching, but it's a simple example |
| 276 | snap := &Snapshot{ |
| 277 | // default value |
| 278 | Administrator: make(map[identity.Interface]struct{}), |
| 279 | SignatureRequired: false, |
| 280 | } |
| 281 | for _, op := range pc.Operations() { |
| 282 | op.(Operation).Apply(snap) |
| 283 | } |
| 284 | return snap |
| 285 | } |
| 286 | |
| 287 | // Read is a helper to load a ProjectConfig from a Repository |
| 288 | func Read(repo repository.ClockedRepo, id entity.Id) (*ProjectConfig, error) { |
nothing calls this directly
no test coverage detected