importer

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: 6 Imported by: 0

Documentation

Overview

Package importer reads live state and prints the config block that describes it.

Writing one of these by hand is how a config ends up describing an app that does not exist — a service id off by a character, a bucket that was renamed, a production branch nobody changed in the file. Reading it off the account is the difference between a tool you configure and a tool you point.

One rule: a live secret is never copied into the output. A variable that looks like a credential comes back as a valueEnv reference with no value, so importing an app cannot be the thing that writes its secrets to disk.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Import

func Import(ctx context.Context, req Request, render Render, cf CF) (string, error)

Import renders a YAML app block from whatever surfaces the request names.

Types

type CF

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

CF is the read half of the Cloudflare API.

type Render

type Render interface {
	EnvVars(ctx context.Context, serviceID string) (map[string]string, error)
}

Render is the read half of the Render API.

type Request

type Request struct {
	Name      string
	AccountID string
	ServiceID string
	Bucket    string
	Pages     string
}

Jump to

Keyboard shortcuts

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