frameworks

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package frameworks is the catalog of first-class framework presets: the port, health path, build mode, env hints and volumes a framework needs to deploy with no manual build config. Data only, no I/O besides Detect.

Index

Constants

View Source
const (
	OutputServer     = "server"
	OutputStandalone = "standalone"
	OutputStatic     = "static"
	OutputJar        = "jar"
	OutputBinary     = "binary"
)

Output modes describe what the build produces.

View Source
const (
	BuildRailpack   = "railpack"
	BuildStatic     = "static"
	BuildDockerfile = "dockerfile"
)

Build types mirror spec.Build* values without importing the spec package.

View Source
const DefaultStaticBuildCommand = "npm run build"

DefaultStaticBuildCommand runs the project's own build script, which every static preset ships, so the package manager and any wrapper stay the author's.

Variables

This section is empty.

Functions

func DockerfileTemplate

func DockerfileTemplate(id string) (string, bool)

DockerfileTemplate returns the tuned Dockerfile for presets that ship one.

Types

type EnvHint

type EnvHint struct {
	Key         string `json:"key"`
	Description string `json:"description"`
	Required    bool   `json:"required"`
	Secret      bool   `json:"secret"`
	Default     string `json:"default,omitempty"`
}

EnvHint is an environment variable the framework commonly needs.

type Match

type Match struct {
	Preset   Preset `json:"preset"`
	Evidence string `json:"evidence"`
}

Match is a detected preset plus the file that decided it.

func Detect

func Detect(read Reader) (Match, bool)

Detect picks the best preset from manifest files, or false when nothing recognisable is present.

type Preset

type Preset struct {
	ID           string       `json:"id"`
	Name         string       `json:"name"`
	Runtime      string       `json:"runtime"`
	Icon         string       `json:"icon"`
	BuildType    string       `json:"build_type"`
	OutputMode   string       `json:"output_mode"`
	Port         int          `json:"port"`
	HealthPath   string       `json:"health_path"`
	BuildCommand string       `json:"build_command,omitempty"`
	PublishDir   string       `json:"publish_dir,omitempty"`
	StartCommand string       `json:"start_command,omitempty"`
	ReadyTimeout string       `json:"ready_timeout,omitempty"`
	Dockerfile   bool         `json:"dockerfile_template"`
	EnvHints     []EnvHint    `json:"env_hints"`
	Volumes      []VolumeHint `json:"volumes"`
	DocsAnchor   string       `json:"docs_anchor"`
}

Preset is one framework's recommended deploy defaults.

func Get

func Get(id string) (Preset, bool)

Get returns the preset with the given id.

func List

func List() []Preset

List returns every preset sorted by name. The slice is a copy.

func (Preset) StaticBuild

func (p Preset) StaticBuild() (command, publish string, ok bool)

StaticBuild returns the build command and publish directory that prefill a static build for a preset, or false when the preset is not a static site with a known output directory.

type Reader

type Reader func(rel string) (string, bool)

Reader returns the text of a file relative to the app root.

type VolumeHint

type VolumeHint struct {
	Name    string `json:"name"`
	Path    string `json:"path"`
	Purpose string `json:"purpose"`
}

VolumeHint is a path worth persisting across deploys.

Jump to

Keyboard shortcuts

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