cli

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: AGPL-3.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the crofty CLI version and the single source the rest of the code reads. Releases inject the git tag at build time: wharfy builds with -ldflags "-X main.version=…", and main() copies that into Version (see main.go). Plain `go build` from source leaves it as "dev".

Functions

func Run

func Run(args []string) int

Run dispatches a subcommand and returns a process exit code. It funnels every path through dispatch() so a single trailing update nudge covers them all (version, help, discover and each command alike).

Types

type Deployer

type Deployer interface {
	// Carries reports the non-asset parts this provider can deliver (every
	// provider delivers the assets themselves). The common layer assembles a
	// bundle without knowing the destination, so this is how it learns what a
	// destination can and cannot take.
	Carries() []deployPart

	// Deploy sends the bundle to the destination. progress receives short
	// human-readable lines so the caller can print them. It returns the site's
	// live URL when the provider knows it ("" when it can't — e.g. an SFTP/FTPS
	// host whose public URL depends on the owner's domain).
	Deploy(b deployBundle, progress func(string)) (url string, err error)
}

A Deployer publishes a built site to one destination. Each deploy provider (Cloudflare Pages, SFTP, FTPS) implements it, so deploy.go can dispatch on the configured provider without knowing the wire details. The build and output- contract steps run once, before any Deployer is constructed — a Deployer only uploads an already-verified build.

Jump to

Keyboard shortcuts

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