Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernise Worker methods and conventions #1137

Merged
merged 6 commits into from Dec 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
39 changes: 39 additions & 0 deletions .changelog/1137.txt
@@ -0,0 +1,39 @@
```release-note:note
workers: all worker methods have been split into product ownership(-ish) files
```

```release-note:note
workers: all worker methods now require an explicit `ResourceContainer` for endpoints instead of relying on the globally defined `api.AccountID`
```

```release-note:breaking-change
workers: method signatures have been updated to align with the upcoming client conventions
```

```release-note:breaking-change
workers: API operations now target account level resources instead of older zone level resources (these are a 1:1 now)
```

```release-note:breaking-change
workers_bindings: method signatures have been updated to align with the upcoming client conventions
```

```release-note:breaking-change
workers_kv: method signatures have been updated to align with the upcoming client conventions
```

```release-note:breaking-change
workers_tails: method signatures have been updated to align with the upcoming client conventions
```

```release-note:breaking-change
workers_secrets: method signatures have been updated to align with the upcoming client conventions
```

```release-note:breaking-change
workers_routes: method signatures have been updated to align with the upcoming client conventions
```

```release-note:breaking-change
workers_cron_triggers: method signatures have been updated to align with the upcoming client conventions
```
5 changes: 4 additions & 1 deletion errors.go
Expand Up @@ -29,7 +29,8 @@ const (
errAPIKeysAndTokensAreMutuallyExclusive = "API keys and tokens are mutually exclusive" //nolint:gosec
errMissingCredentials = "no credentials provided"

errInvalidResourceContainerAccess = "requested resource container (%q) is not supported for this endpoint"
errInvalidResourceContainerAccess = "requested resource container (%q) is not supported for this endpoint"
errRequiredAccountLevelResourceContainer = "this endpoint requires using an account level resource container and identifiers"
)

var (
Expand All @@ -40,6 +41,8 @@ var (
ErrAccountIDOrZoneIDAreRequired = errors.New(errMissingAccountOrZoneID)
ErrAccountIDAndZoneIDAreMutuallyExclusive = errors.New(errAccountIDAndZoneIDAreMutuallyExclusive)
ErrMissingResourceIdentifier = errors.New(errMissingResourceIdentifier)

ErrRequiredAccountLevelResourceContainer = errors.New(errRequiredAccountLevelResourceContainer)
)

type ErrorType string
Expand Down