Add the /commands path to handle a set of commands
Entirely synchronous now but allows for the "move" command
This commit is contained in:
parent
e5d5d123a6
commit
e2857d7506
5 changed files with 169 additions and 19 deletions
|
@ -71,3 +71,12 @@ func (a *Accountant) AssignPrimary(account uuid.UUID, instance uuid.UUID) error
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetPrimary gets the primary instance for the account
|
||||
func (a *Accountant) GetPrimary(account uuid.UUID) (uuid.UUID, error) {
|
||||
// Find the account matching the ID
|
||||
if this, ok := a.Accounts[account]; ok {
|
||||
return this.Primary, nil
|
||||
}
|
||||
return uuid.UUID{}, fmt.Errorf("no account found for id: %s", account)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue