workers

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package workers plans a Cloudflare Worker's secrets and routes.

For a product whose backend is a Worker rather than a container. It manages the two things that break quietly:

  • A secret the script expects and the account does not have. The Worker deploys, serves most requests, and one code path throws — which is the failure this whole tool was written after.
  • A route the Worker should answer on and does not. Traffic reaches the zone's normal handling instead, so the site "works" and one path is someone else's.

Like Fly, Cloudflare returns a secret's NAME and never its value. So upkeep reports a secret as missing and can set one, but cannot tell you an existing one is wrong, and it says nothing rather than claiming a comparison it did not make.

The script itself is not managed. Uploading a Worker is `wrangler deploy`, which does bundling, source maps and migrations — reimplementing it to own one more field would be a worse tool, not a more complete one.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Plan

func Plan(
	ctx context.Context,
	api API,
	w config.Workers,
	getenv func(string) string,
	secrets *secret.Set,
) (plan.Plan, error)

Plan diffs the declared secrets and routes against the account.

Types

type API

type API interface {
	Do(ctx context.Context, method, path string, body, result any) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL