status

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

Documentation

Overview

Package status answers "what is live right now" without diffing anything.

A plan answers a different question — how does the world differ from this file — and answering the first with the second means reading a list of changes and inferring the state behind it. This reads the state and says it.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Write

func Write(w io.Writer, apps []App) error

Write renders the state as aligned columns.

func WriteJSON

func WriteJSON(w io.Writer, apps []App) error

WriteJSON renders the same for something other than a person.

Types

type App

type App struct {
	Name     string    `json:"name"`
	Surfaces []Surface `json:"surfaces"`
}

App is what one app looks like right now. Every field is a fact read from a provider, or the reason it could not be.

func Read

func Read(ctx context.Context, apps []config.App, render Render, cf CF) []App

Read gathers the state of every app given.

type CF

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

CF is the Cloudflare transport.

type Render

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

Render is the read half of the service provider.

type Surface

type Surface struct {
	Kind   string `json:"kind"`
	Target string `json:"target"`
	// State is a short human phrase: "12 variables", "public, 1 CORS rule".
	State string `json:"state"`
	// Problem is set when the surface could not be read, and is never empty
	// just because something is absent — absent is a state, not a failure.
	Problem string `json:"problem,omitempty"`
}

Surface is one place an app lives.

Jump to

Keyboard shortcuts

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