store: add function to get blueprint changes
For a given blueprint name the store returns a list of the changes made to that blueprint.
This commit is contained in:
parent
7d2650a2e3
commit
080bd4968c
1 changed files with 13 additions and 0 deletions
|
|
@ -368,6 +368,19 @@ func (s *Store) GetBlueprintCommitted(name string, bp *blueprint.Blueprint) bool
|
|||
return true
|
||||
}
|
||||
|
||||
func (s *Store) GetBlueprintChanges(name string) []blueprint.Change {
|
||||
s.mu.RLock()
|
||||
defer s.mu.RUnlock()
|
||||
|
||||
var changes []blueprint.Change
|
||||
|
||||
for _, change := range s.BlueprintsChanges[name] {
|
||||
changes = append(changes, change)
|
||||
}
|
||||
|
||||
return changes
|
||||
}
|
||||
|
||||
func (s *Store) PushBlueprint(bp blueprint.Blueprint) {
|
||||
s.change(func() error {
|
||||
hash := sha1.New()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue