environment

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CIEnvironment

type CIEnvironment string

CIEnvironment represents different CI/CD platforms

const (
	// CI Platforms
	CIUnknown        CIEnvironment = "unknown"
	CIGitHubActions  CIEnvironment = "github_actions"
	CIGitLabCI       CIEnvironment = "gitlab_ci"
	CIJenkins        CIEnvironment = "jenkins"
	CITravisCI       CIEnvironment = "travis_ci"
	CICircleCI       CIEnvironment = "circle_ci"
	CIBuildkite      CIEnvironment = "buildkite"
	CITeamCity       CIEnvironment = "teamcity"
	CIBamboo         CIEnvironment = "bamboo"
	CIAppVeyor       CIEnvironment = "appveyor"
	CIAzurePipelines CIEnvironment = "azure_pipelines"
	CICodeBuild      CIEnvironment = "codebuild"
	CIDrone          CIEnvironment = "drone"
	CISemaphore      CIEnvironment = "semaphore"
	CIGeneric        CIEnvironment = "generic_ci"
)

type Detector

type Detector struct{}

Detector handles environment detection

func NewDetector

func NewDetector() *Detector

NewDetector creates a new environment detector

func (*Detector) DetectEnvironment

func (d *Detector) DetectEnvironment() *EnvironmentInfo

DetectEnvironment detects the current environment and its capabilities

func (*Detector) GetRecommendedDisplayMode

func (d *Detector) GetRecommendedDisplayMode(info *EnvironmentInfo) string

GetRecommendedDisplayMode returns the recommended display mode for the environment

func (*Detector) IsCI

func (d *Detector) IsCI() bool

IsCI returns true if running in a CI environment

func (*Detector) ShouldBeQuiet

func (d *Detector) ShouldBeQuiet() bool

ShouldBeQuiet returns true if output should be minimal/suppressed

type EnvironmentInfo

type EnvironmentInfo struct {
	IsCI                 bool
	CIEnvironment        CIEnvironment
	SupportColors        bool
	SupportInteractive   bool
	SupportEmojis        bool
	TerminalType         string
	ShouldSuppressOutput bool
}

EnvironmentInfo contains information about the current environment

Jump to

Keyboard shortcuts

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