project

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersions

func CompareVersions(a, b string) int

CompareVersions returns -1 if a < b, 0 if equal (or unparseable), 1 if a > b.

func VersionStaleness

func VersionStaleness(current, latest string) string

VersionStaleness returns "error" (>1 major behind), "warning" (>=2 minor behind), or "" (up-to-date or unparseable).

Types

type Fact

type Fact struct {
	Key   string
	Value string
	Warn  string
}

type Finding

type Finding struct {
	Category string // "dependency", "version", "practice", "constraint"
	Severity string // "error", "warning", "info"
	Message  string
	Fix      string
}

Finding is a single health-check result for the current project.

func Check

func Check(ctx *ProjectContext, cwd string, packs []*content.Pack) []Finding

Check runs all health-check categories against the project and returns a (possibly empty) slice of findings.

type ProjectContext

type ProjectContext struct {
	Type             string
	CAPVersion       string
	LatestCAP        string
	Database         string
	Deployment       string
	Auth             string
	HasCDSRC         bool
	HasDefaultEnv    bool
	BTPGlobalAccount string
	BTPSubaccount    string
	BTPRegion        string
	BTPIsTrial       bool
	CFOrg            string
	CFSpace          string
	CFRegion         string
	Facts            []Fact
	RawFiles         map[string]bool
}

func Detect

func Detect(cwd string) (*ProjectContext, error)

func (*ProjectContext) HasBTPContext

func (ctx *ProjectContext) HasBTPContext() bool

HasBTPContext reports whether any BTP or Cloud Foundry target is detected.

func (*ProjectContext) RebuildFacts

func (ctx *ProjectContext) RebuildFacts()

RebuildFacts re-derives the Facts slice from the current typed fields. Call this after enriching LatestCAP from pack metadata.

Jump to

Keyboard shortcuts

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