common

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PourBottleConditionDefaultPrefix = "default_prefix" // pour bottle condition requiring the default prefix
	PourBottleConditionCLTInstalled  = "clt_installed"  // pour bottle condition requiring the macOS command line tools
)

Pour bottle conditions.

View Source
const (
	CellarAny               = ":any"                 // Signifies bottle is safe to install in the Cellar.
	CellarAnySkipRelocation = ":any_skip_relocation" // Signifies bottle is safe to install in the Cellar without relocation.
)

Bottle Cellar values.

View Source
const (
	ProcessTypeInteractive = "interactive" // value for interactive process
	ProcessTypeBackground  = "background"  // value for background process
)

Known process types.

Variables

View Source
var FormulaDeprecateDisableReasons = map[string]string{
	"does_not_build":      "does not build",
	"no_license":          "has no license",
	"repo_archived":       "has an archived upstream repository",
	"repo_removed":        "has a removed upstream repository",
	"unmaintained":        "is not maintained upstream",
	"unsupported":         "is not supported upstream",
	"deprecated_upstream": "is deprecated upstream",
	"versioned_formula":   "is a versioned formula",
	"checksum_mismatch": heredoc.Doc(`
		was built with an initially released source file that had 
		a different checksum than the current one.
		Upstream's repository might have been compromised.
		We can re-package this once upstream has confirmed that they retagged their release`),
}

FormulaDeprecateDisableReasons contains known deprecation and disabling reasons.

https://github.com/Homebrew/brew/blob/master/Library/Homebrew/deprecate_disable.rb

Functions

func CellarRelocatable

func CellarRelocatable(c string) bool

Relocatable reports if the Cellar value means the Bottle is relocatable.

Types

type CaskArtifact

type CaskArtifact map[string][]any

CaskArtifact represents an artifact stanza defined by a cask.

https://docs.brew.sh/Cask-Cookbook#stanza-descriptions

type CaskDependencies

type CaskDependencies map[string][]string

CaskDependencies defines Cask dependencies.

type FormulaDeprecateReason

type FormulaDeprecateReason string

FormulaDeprecateReason describes why a formula was deprecated.

func (FormulaDeprecateReason) MarshalJSON

func (r FormulaDeprecateReason) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*FormulaDeprecateReason) UnmarshalJSON

func (r *FormulaDeprecateReason) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type FormulaDisableReason

type FormulaDisableReason string

FormulaDisableReason describes why a formula was disabled.

func (FormulaDisableReason) MarshalJSON

func (r FormulaDisableReason) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*FormulaDisableReason) UnmarshalJSON

func (r *FormulaDisableReason) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type KeepAliveConfig

type KeepAliveConfig struct {
	Always         bool `json:"always,omitempty"`
	SuccessfulExit bool `json:"successful_exit,omitempty"`
	Crashed        bool `json:"crashed,omitempty"` // 1 example
}

KeepAliveConfig declares what happens when a service exits.

type KegOnlyConfig

type KegOnlyConfig struct {
	Reason      KegOnlyReason `json:"reason,omitempty"`
	Explanation string        `json:"explanation,omitempty"`
}

KegOnlyConfig declares if a formula is keg-only and why.

type KegOnlyReason

type KegOnlyReason string

KegOnlyReason is used for the reason field in keg_only_reason.

func (KegOnlyReason) MarshalJSON

func (r KegOnlyReason) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*KegOnlyReason) UnmarshalJSON

func (r *KegOnlyReason) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type ProcessType

type ProcessType string

ProcessType represents a service's process type.

type Service

type Service struct {
	// Specifies per-OS service name
	// 2 examples: xinit, dbus
	// Both only specify a name for "macos"
	Name map[string]string `json:"name,omitempty"`

	// Run specifies the command to run
	//
	// One of three options:
	// - string: single argument (60 examples)
	// - []string: list of args (234 examples)
	// - map[string][]string: map OS to list of args (3 examples)
	//
	// Parse as any, require furthing parsing if needed
	Run any `json:"run"`

	RunType              ServiceRunType    `json:"run_type"`
	EnvironmentVariables map[string]string `json:"environment_variables,omitempty"`
	Interval             time.Duration     `json:"interval,omitempty"`
	Cron                 string            `json:"cron,omitempty"`
	RequireRoot          bool              `json:"require_root,omitempty"`
	KeepAlive            KeepAliveConfig   `json:"keep_alive,omitempty"`
	WorkingDir           string            `json:"working_dir,omitempty"`

	// 2 examples: knot-resolver, knot
	InputPath string `json:"input_path,omitempty"`

	LogPath string `json:"log_path,omitempty"`

	ErrorLogPath string `json:"error_log_path,omitempty"`

	// 3 examples: bitlbee, launch_socket_server, launchdns
	Sockets string `json:"sockets,omitempty"`

	// 4 examples
	// seen: background|interactive
	ProcessType ProcessType `json:"process_type,omitempty"`

	// 1 example: gitlab-runner
	MacOSLegacyTimers bool `json:"macos_legacy_timers,omitempty"`
}

Service represents the service block.

https://docs.brew.sh/Formula-Cookbook#service-block-methods

func (*Service) RunArgs

func (s *Service) RunArgs(os string) ([]string, error)

RunArgs evaluates the command arguments to run The run field is a dynamic type so it needs extra parsing.

type ServiceRunType

type ServiceRunType string

ServiceRunType represents a run type for a service.

const (
	RunTypeImmediate ServiceRunType = "immediate" // immediate run type
	RunTypeInterval  ServiceRunType = "interval"  // interval run type
	RunTypeCron      ServiceRunType = "cron"      // cron run type
)

Known run types.

Jump to

Keyboard shortcuts

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