project

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateBakeFile

func GenerateBakeFile(d Detection) string

func GenerateComposeFile

func GenerateComposeFile(d Detection, cfg Config) string

func GenerateDockerfile

func GenerateDockerfile(d Detection) string

func GenerateDockerignore

func GenerateDockerignore(d Detection) string

func GenerateFlyFile

func GenerateFlyFile(d Detection, cfg Config) string

func GenerateGitHubActionsWorkflow

func GenerateGitHubActionsWorkflow(d Detection, cfg Config) string

func GenerateGitLabCI

func GenerateGitLabCI(d Detection, cfg Config) string

func GenerateRenderFile

func GenerateRenderFile(d Detection, cfg Config) string

Types

type BuildTool

type BuildTool string
const (
	BuildToolNone   BuildTool = ""
	BuildToolMaven  BuildTool = "maven"
	BuildToolGradle BuildTool = "gradle"
	BuildToolPip    BuildTool = "pip"
)

type CIConfig

type CIConfig struct {
	Image      string         `yaml:"image"`
	MainBranch string         `yaml:"main_branch"`
	Context    string         `yaml:"context"`
	Platforms  []string       `yaml:"platforms"`
	Auto       *bool          `yaml:"auto"`
	Verify     *bool          `yaml:"verify"`
	Push       *bool          `yaml:"push"`
	Deploy     string         `yaml:"deploy"`
	DeployPath string         `yaml:"deploy_path"`
	GitHub     GitHubCIConfig `yaml:"github"`
	GitLab     GitLabCIConfig `yaml:"gitlab"`
}

type CISpec

type CISpec struct {
	Name               string
	ImageName          string
	Context            string
	Image              string
	Registry           string
	MainBranch         string
	Platforms          []string
	Auto               bool
	Verify             bool
	Push               bool
	VerifyPath         string
	DeployTarget       string
	DeployPath         string
	GitHubWorkflowFile string
	GitLabFile         string
	KforgeVersion      string
}

func ResolveCISpec

func ResolveCISpec(d Detection, cfg Config, provider string) CISpec

type ComposeConfig

type ComposeConfig struct {
	Service string `yaml:"service"`
}

type Config

type Config struct {
	Framework      string            `yaml:"framework"`
	Image          string            `yaml:"image"`
	Node           string            `yaml:"node"`
	Python         string            `yaml:"python"`
	Java           string            `yaml:"java"`
	Port           int               `yaml:"port"`
	Healthcheck    string            `yaml:"healthcheck"`
	AppModule      string            `yaml:"app_module"`
	SettingsModule string            `yaml:"settings_module"`
	StartCommand   []string          `yaml:"start_command"`
	Env            map[string]string `yaml:"env"`
	Verify         VerifyConfig      `yaml:"verify"`
	Deploy         DeployConfig      `yaml:"deploy"`
	CI             CIConfig          `yaml:"ci"`
}

func LoadConfig

func LoadConfig(root string) (Config, string, error)

type DeployConfig

type DeployConfig struct {
	Port        int               `yaml:"port"`
	Healthcheck string            `yaml:"healthcheck"`
	Command     []string          `yaml:"command"`
	Domains     []string          `yaml:"domains"`
	Env         map[string]string `yaml:"env"`
	Compose     ComposeConfig     `yaml:"compose"`
	Render      RenderConfig      `yaml:"render"`
	Fly         FlyConfig         `yaml:"fly"`
}

type DeploySpec

type DeploySpec struct {
	Name         string
	ServiceName  string
	Port         int
	Healthcheck  string
	Command      []string
	Env          map[string]string
	Domains      []string
	RenderName   string
	RenderPlan   string
	RenderRegion string
	FlyApp       string
	FlyRegion    string
	FlyMemoryMB  int
}

func ResolveDeploySpec

func ResolveDeploySpec(d Detection, cfg Config) DeploySpec

type Detection

type Detection struct {
	Root              string
	Name              string
	Framework         Framework
	ConfigPath        string
	PackageManager    PackageManager
	BuildTool         BuildTool
	HasLockfile       bool
	NodeVersion       string
	NodeVersionFrom   string
	PythonVersion     string
	PythonVersionFrom string
	JavaVersion       string
	JavaVersionFrom   string
	BuildOutput       string
	Port              int
	HasDockerfile     bool
	HasPackageJSON    bool
	HasBuildScript    bool
	HasPublicDir      bool
	HasRequirements   bool
	HasPyProject      bool
	HasPomXML         bool
	HasGradleBuild    bool
	NextStandalone    bool
	AppModule         string
	SettingsModule    string
	HealthcheckPath   string
	StartCommand      []string
	EnvDefaults       map[string]string
	VerifyPath        string
	VerifyPort        int
	VerifyTimeout     int
	Warnings          []string
	// contains filtered or unexported fields
}

func Detect

func Detect(root, frameworkOverride, nodeOverride string) (Detection, error)

func DetectWithOverrides

func DetectWithOverrides(root, frameworkOverride, nodeOverride, pythonOverride, javaOverride string) (Detection, error)

func (Detection) DisplayFramework

func (d Detection) DisplayFramework() string

func (Detection) RuntimeDisplay

func (d Detection) RuntimeDisplay() string

func (Detection) RuntimeSource

func (d Detection) RuntimeSource() string

func (Detection) SuggestedImageName

func (d Detection) SuggestedImageName() string

func (Detection) ToolchainDisplay

func (d Detection) ToolchainDisplay() string

type FlyConfig

type FlyConfig struct {
	App           string `yaml:"app"`
	PrimaryRegion string `yaml:"primary_region"`
	MemoryMB      int    `yaml:"memory_mb"`
}

type Framework

type Framework string
const (
	FrameworkUnknown Framework = ""
	FrameworkNext    Framework = "next"
	FrameworkReact   Framework = "react"
	FrameworkVue     Framework = "vue"
	FrameworkNest    Framework = "nest"
	FrameworkHTML    Framework = "html"
	FrameworkNode    Framework = "node"
	FrameworkSpring  Framework = "spring"
	FrameworkFastAPI Framework = "fastapi"
	FrameworkFlask   Framework = "flask"
	FrameworkDjango  Framework = "django"
)

type GitHubCIConfig

type GitHubCIConfig struct {
	Workflow string `yaml:"workflow"`
}

type GitLabCIConfig

type GitLabCIConfig struct {
	File string `yaml:"file"`
}

type PackageManager

type PackageManager string
const (
	PackageManagerNone PackageManager = ""
	PackageManagerNPM  PackageManager = "npm"
	PackageManagerYarn PackageManager = "yarn"
	PackageManagerPNPM PackageManager = "pnpm"
)

type RenderConfig

type RenderConfig struct {
	Name   string `yaml:"name"`
	Plan   string `yaml:"plan"`
	Region string `yaml:"region"`
}

type VerifyConfig

type VerifyConfig struct {
	Path           string            `yaml:"path"`
	Port           int               `yaml:"port"`
	TimeoutSeconds int               `yaml:"timeout_seconds"`
	Env            map[string]string `yaml:"env"`
}

Jump to

Keyboard shortcuts

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