setupguide

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package setupguide derives the Get started checklist from real instance state. It is pure: callers gather an Input, Derive returns the guide.

Index

Constants

View Source
const (
	ReasonTLSUpstream  = "tls_terminated_upstream"
	ReasonProxyMode    = "proxy_mode"
	ReasonUnavailable  = "unavailable"
	ReasonHTTPOnly     = "http_only"
	ReasonNoRules      = "no_alert_rule"
	ReasonCertsPending = "certificates_pending"
	ReasonACMEOff      = "acme_disabled"
	ReasonManual       = "marked_done"
)

Reason codes explain why a step is not applicable or only partly done.

View Source
const (
	OverrideSkipped = "skipped"
	OverrideDone    = "done"
)

Override values an operator can record.

Variables

This section is empty.

Functions

func ValidStep

func ValidStep(id string) bool

ValidStep reports whether id names a known step.

Types

type DomainTLS

type DomainTLS struct {
	Name        string
	CertHealthy bool
}

DomainTLS is one attached app domain and whether it has a healthy cert.

type Guide

type Guide struct {
	Steps         []Step `json:"steps"`
	ReadyPercent  int    `json:"ready_percent"`
	Done          int    `json:"done"`
	Total         int    `json:"total"`
	NextStep      StepID `json:"next_step,omitempty"`
	Complete      bool   `json:"complete"`
	Hidden        bool   `json:"hidden"`
	ServerAddress string `json:"server_address,omitempty"`
}

Guide is the derived checklist.

func Derive

func Derive(in Input) Guide

Derive computes the guide. Derived "done" always wins over an override, so a skipped step that later completes shows as done.

type Input

type Input struct {
	SecuredAdmin         bool
	DashboardURL         string
	ServerAddress        string
	BehindProxy          bool
	ACMEEnabled          bool
	GitConnected         bool
	Apps                 int
	Domains              []DomainTLS
	DNSProviderConnected bool
	BackupTargets        int
	ControlPlaneBackups  int
	VerifiedBackups      int
	Channels             int
	AlertRules           int
	Users                int
	PendingInvites       int
	AutomaticUpgrades    bool

	// Unavailable lists steps whose source data could not be read.
	Unavailable map[StepID]bool
	// Overrides holds operator overrides keyed by step id.
	Overrides map[StepID]string
	Hidden    bool
}

Input is everything Derive needs. Zero values mean "nothing set up yet".

type Progress

type Progress struct {
	Done  int `json:"done"`
	Total int `json:"total"`
}

Progress counts done items of a multi-item step.

type State

type State string

State is a step's current state.

const (
	StateTodo          State = "todo"
	StateInProgress    State = "in_progress"
	StateDone          State = "done"
	StateSkipped       State = "skipped"
	StateNotApplicable State = "not_applicable"
)

Step states.

type Step

type Step struct {
	ID              StepID    `json:"id"`
	Title           string    `json:"title"`
	State           State     `json:"state"`
	Optional        bool      `json:"optional"`
	EstimateMinutes int       `json:"estimate_minutes"`
	Href            string    `json:"href"`
	BlockedBy       []StepID  `json:"blocked_by,omitempty"`
	Reason          string    `json:"reason,omitempty"`
	Progress        *Progress `json:"progress,omitempty"`
	Manual          bool      `json:"manual,omitempty"`
}

Step is one derived checklist entry.

type StepID

type StepID string

StepID names one checklist step.

const (
	StepSecureAdmin    StepID = "secure_admin"
	StepPublicAddress  StepID = "public_address"
	StepGitProvider    StepID = "git_provider"
	StepFirstApp       StepID = "first_app"
	StepAppDomain      StepID = "app_domain"
	StepDNS            StepID = "dns"
	StepTLS            StepID = "tls"
	StepBackupTarget   StepID = "backup_target"
	StepFirstBackup    StepID = "first_backup"
	StepVerifiedBackup StepID = "verified_restore"
	StepNotifications  StepID = "notifications"
	StepTeammate       StepID = "teammate"
	StepUpgrades       StepID = "upgrades"
)

Step identifiers, in presentation order.

func StepIDs

func StepIDs() []StepID

StepIDs returns every step id in presentation order.

Jump to

Keyboard shortcuts

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