Skip to content

Commit

Permalink
feat: add validation helper
Browse files Browse the repository at this point in the history
  • Loading branch information
joshiste committed Jun 21, 2024
1 parent 7ad2dd3 commit b788d79
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/action_kit_test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.2.15

- Add endpoint validation helper

## 1.2.14

- Fix: Nil pointer deref
Expand Down
27 changes: 27 additions & 0 deletions go/action_kit_test/validate/validate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2024 Steadybit GmbH

package validate

import (
"errors"
"github.com/go-resty/resty/v2"
"github.com/steadybit/action-kit/go/action_kit_test/client"
)

func ValidateEndpointReferences(path string, restyClient *resty.Client) error {
c := client.NewActionClient(path, restyClient)
var allErr []error

list, err := c.ListActions()
if err != nil {
allErr = append(allErr, err)
}

for _, action := range list.Actions {
_, err := c.DescribeAction(action)
allErr = append(allErr, err)
}

return errors.Join(allErr...)
}

0 comments on commit b788d79

Please sign in to comment.