Skip to content
Snippets Groups Projects

Improve usability and better output formatting for gosndc

Merged Malte Bauch requested to merge cli-refactoring-pterm into develop
5 files
+ 47
27
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 6
8
@@ -197,24 +197,22 @@ func (p *PndAdapter) Endpoint() string {
@@ -197,24 +197,22 @@ func (p *PndAdapter) Endpoint() string {
// PendingChanges sends an API call to the controller requesting
// PendingChanges sends an API call to the controller requesting
// the UUIDs of all pending changes
// the UUIDs of all pending changes
func (p *PndAdapter) PendingChanges() []uuid.UUID {
func (p *PndAdapter) PendingChanges() ([]uuid.UUID, error) {
resp, err := api.GetChanges(p.endpoint, p.id.String())
resp, err := api.GetChanges(p.endpoint, p.id.String())
if err != nil {
if err != nil {
log.Error(err)
return nil, err
return nil
}
}
return filterChanges(ppb.ChangeState_CHANGE_STATE_PENDING, resp)
return filterChanges(ppb.ChangeState_CHANGE_STATE_PENDING, resp), nil
}
}
// CommittedChanges sends an API call to the controller requesting
// CommittedChanges sends an API call to the controller requesting
// the UUIDs of all committed changes
// the UUIDs of all committed changes
func (p *PndAdapter) CommittedChanges() []uuid.UUID {
func (p *PndAdapter) CommittedChanges() ([]uuid.UUID, error) {
resp, err := api.GetChanges(p.endpoint, p.id.String())
resp, err := api.GetChanges(p.endpoint, p.id.String())
if err != nil {
if err != nil {
log.Error(err)
return nil, err
return nil
}
}
return filterChanges(ppb.ChangeState_CHANGE_STATE_COMMITTED, resp)
return filterChanges(ppb.ChangeState_CHANGE_STATE_COMMITTED, resp), nil
}
}
// GetChange sends an API call to the controller requesting the specified change
// GetChange sends an API call to the controller requesting the specified change
Loading