core

package
v0.0.0-...-41454cb Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnsiRed           = "1"
	AnsiYellow        = "3"
	AnsiBlue          = "4"
	AnsiMagenta       = "5"
	AnsiCyan          = "6"
	AnsiWhite         = "7"
	AnsiGray          = "8"
	AnsiBrightBlue    = "12"
	AnsiBrightCyan    = "14"
	AnsiBrightWhite   = "15"
	AnsiBrightMagenta = "13"
	AnsiDarkGray      = "238"
	AnsiMediumGray    = "245"
)

Variables

This section is empty.

Functions

func FormatBuildResult

func FormatBuildResult(br *BuildResult, options ...PrintOptions) string

func GenerateConfigFromEnvironment

func GenerateConfigFromEnvironment(env *app.Environment) *c.Config

GenerateConfigFromEnvironment generates a config from the environment

func GenerateConfigFromFile

func GenerateConfigFromFile(app *app.App, env *app.Environment, options *GenerateBuildPlanOptions, logger *logger.Logger) (*c.Config, error)

GenerateConfigFromFile generates a config from the config file

func GenerateConfigFromOptions

func GenerateConfigFromOptions(options *GenerateBuildPlanOptions) *c.Config

GenerateConfigFromOptions generates a config from the CLI options

func GetConfig

func GetConfig(app *app.App, env *app.Environment, options *GenerateBuildPlanOptions, logger *logger.Logger) (*c.Config, error)

GetConfig merges the options, environment, and file config into a single config

func PrettyPrintBuildResult

func PrettyPrintBuildResult(buildResult *BuildResult, options ...PrintOptions)

func ValidatePlan

func ValidatePlan(plan *plan.BuildPlan, app *app.App, logger *logger.Logger, options *ValidatePlanOptions) bool

Types

type BuildResult

type BuildResult struct {
	RailpackVersion   string                               `json:"railpackVersion,omitempty"`
	Plan              *plan.BuildPlan                      `json:"plan,omitempty"`
	ResolvedPackages  map[string]*resolver.ResolvedPackage `json:"resolvedPackages,omitempty"`
	Metadata          map[string]string                    `json:"metadata,omitempty"`
	DetectedProviders []string                             `json:"detectedProviders,omitempty"`
	Logs              []logger.Msg                         `json:"logs,omitempty"`
	Success           bool                                 `json:"success,omitempty"`
}

func GenerateBuildPlan

func GenerateBuildPlan(app *app.App, env *app.Environment, options *GenerateBuildPlanOptions) *BuildResult

type GenerateBuildPlanOptions

type GenerateBuildPlanOptions struct {
	RailpackVersion          string
	BuildCommand             string
	StartCommand             string
	PreviousVersions         map[string]string
	ConfigFilePath           string
	ErrorMissingStartCommand bool
}

type PrintOptions

type PrintOptions struct {
	Metadata bool
	Version  string
}

type ValidatePlanOptions

type ValidatePlanOptions struct {
	ErrorMissingStartCommand bool
	ProviderToUse            providers.Provider
}

Jump to

Keyboard shortcuts

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