common

package
v0.0.0-...-c2df288 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

This package hold commonly shared parts of code. Should not have dependencis to other rcc packages.

Index

Constants

View Source
const (
	CategoryUndefined           = 0
	CategoryLongPath            = 1010
	CategoryLockFile            = 1020
	CategoryLockPid             = 1021
	CategoryPathCheck           = 1030
	CategoryEnvVarCheck         = 1040
	CategoryHolotreeShared      = 2010
	CategoryRobocorpHome        = 3010
	CategoryRobocorpHomeMembers = 3020
	CategoryNetworkDNS          = 4010
	CategoryNetworkLink         = 4020
	CategoryNetworkHEAD         = 4030
	CategoryNetworkCanary       = 4040
	CategoryNetworkTLSVersion   = 4050
	CategoryNetworkTLSVerify    = 4060
	CategoryNetworkTLSChain     = 4070
	CategoryEnvironmentCache    = 5010
)
View Source
const (
	StatusOk      = `ok`
	StatusWarning = `warning`
	StatusFail    = `fail`
	StatusFatal   = `fatal`
)
View Source
const (
	ROBOCORP_HOME_VARIABLE                = `ROBOCORP_HOME`
	RCC_REMOTE_ORIGIN                     = `RCC_REMOTE_ORIGIN`
	RCC_REMOTE_AUTHORIZATION              = `RCC_REMOTE_AUTHORIZATION`
	RCC_NO_TEMP_MANAGEMENT                = `RCC_NO_TEMP_MANAGEMENT`
	RCC_NO_PYC_MANAGEMENT                 = `RCC_NO_PYC_MANAGEMENT`
	VERBOSE_ENVIRONMENT_BUILDING          = `RCC_VERBOSE_ENVIRONMENT_BUILDING`
	ROBOCORP_OVERRIDE_SYSTEM_REQUIREMENTS = `ROBOCORP_OVERRIDE_SYSTEM_REQUIREMENTS`
	RCC_VERBOSITY                         = `RCC_VERBOSITY`
	SILENTLY                              = `silent`
	TRACING                               = `trace`
	DEBUGGING                             = `debug`
)
View Source
const (
	Version = `v17.28.2`
)

Variables

View Source
var (
	Identities chan string
	Startup    time.Time
)
View Source
var (
	NoBuild                 bool
	NoRetryBuild            bool
	NoTempManagement        bool
	NoPycManagement         bool
	ExternallyManaged       bool
	DeveloperFlag           bool
	StrictFlag              bool
	SharedHolotree          bool
	LogLinenumbers          bool
	NoCache                 bool
	NoOutputCapture         bool
	Liveonly                bool
	UnmanagedSpace          bool
	FreshlyBuildEnvironment bool
	WarrantyVoidedFlag      bool
	BundledFlag             bool
	StageFolder             string
	ControllerType          string
	HolotreeSpace           string
	EnvironmentHash         string
	SemanticTag             string
	ForcedRobocorpHome      string
	When                    int64
	Clock                   *stopwatch

	LogHides []string
)
View Source
var (
	TimelineEnabled bool
)

Functions

func AcceptableOutput

func AcceptableOutput(message string) bool

func BadHololibScriptsLocation

func BadHololibScriptsLocation() string

func BadHololibSitePackagesLocation

func BadHololibSitePackagesLocation() string

func BinLocation

func BinLocation() string

func BinRcc

func BinRcc() string

func BlueprintHash

func BlueprintHash(blueprint []byte) string

func CaBundleFile

func CaBundleFile() string

func ControllerIdentity

func ControllerIdentity() string

func DayCountSince

func DayCountSince(timestamp time.Time) int

func Debug

func Debug(format string, details ...interface{}) error

func DebugFlag

func DebugFlag() bool

func DefineVerbosity

func DefineVerbosity(silent, debug, trace bool)

func Digest

func Digest(content string) string

func DisablePycManagement

func DisablePycManagement() bool

func DisableTempManagement

func DisableTempManagement() bool

func EndOfTimeline

func EndOfTimeline()

func Entropy

func Entropy(input []byte) float64

func Error

func Error(context string, err error)

func EventJournal

func EventJournal() string

func Exit

func Exit(code int, format string, rest ...interface{})

func ExpandPath

func ExpandPath(entry string) string

func Fatal

func Fatal(context string, err error)

func ForceDebug

func ForceDebug()

func Gcd

func Gcd(left, right int64) int64

func GenerateKillCommand

func GenerateKillCommand(keys []int) string

func Hexdigest

func Hexdigest(raw []byte) string

func HoloInitCommonFile

func HoloInitCommonFile() string

func HoloInitLocation

func HoloInitLocation() string

func HoloInitUserFile

func HoloInitUserFile() string

func HoloLocation

func HoloLocation() string

func HololibCatalogLocation

func HololibCatalogLocation() string

func HololibCompressMarker

func HololibCompressMarker() string

func HololibLibraryLocation

func HololibLibraryLocation() string

func HololibLocation

func HololibLocation() string

func HololibPids

func HololibPids() string

func HololibUsageLocation

func HololibUsageLocation() string

func HolotreeLocation

func HolotreeLocation() string

func HolotreeLock

func HolotreeLock() string

func IgnoreAllPanics

func IgnoreAllPanics()

func IsBundled

func IsBundled() bool

func IsInsideRobocorpHome

func IsInsideRobocorpHome(location string) (_ bool, err error)

func JournalLocation

func JournalLocation() string

func Log

func Log(format string, details ...interface{})

func MambaPackages

func MambaPackages() string

func MambaRootPrefix

func MambaRootPrefix() string

func MicroMambaRcFile

func MicroMambaRcFile() string

func MicromambaLocation

func MicromambaLocation() string

func NewDigester

func NewDigester(legacy bool) hash.Hash

func OldEventJournal

func OldEventJournal() string

func OneOutOf

func OneOutOf(limit uint8) bool

func OverrideSystemRequirements

func OverrideSystemRequirements() bool

func PipCache

func PipCache() string

func PipRcFile

func PipRcFile() string

func Platform

func Platform() string

func PlatformSyncDelay

func PlatformSyncDelay()

func RandomIdentifier

func RandomIdentifier() string

func RccRemoteAuthorization

func RccRemoteAuthorization() (string, bool)

func RccRemoteOrigin

func RccRemoteOrigin() string

func RegisterJournal

func RegisterJournal(target runJournal)

func RobocorpHome

func RobocorpHome() string

func RobocorpLock

func RobocorpLock() string

func RobocorpTemp

func RobocorpTemp() string

func RobocorpTempName

func RobocorpTempName() string

func RobocorpTempRoot

func RobocorpTempRoot() string

func RobotCache

func RobotCache() string

func RunJournal

func RunJournal(event, detail, commentForm string, fields ...interface{}) error

func SettingsFile

func SettingsFile() string

func SharedMarkerLocation

func SharedMarkerLocation() string

func ShortDigest

func ShortDigest(content string) string

func Silent

func Silent() bool

func Siphash

func Siphash(left, right uint64, body []byte) uint64

func Sipit

func Sipit(key []byte) uint64

func Stdout

func Stdout(format string, details ...interface{})

func Stopwatch

func Stopwatch(form string, details ...interface{}) *stopwatch

func SymbolicUserIdentity

func SymbolicUserIdentity() string

func TemplateLocation

func TemplateLocation() string

func Textual

func Textual(key uint64, size int) string

func Timeline

func Timeline(form string, details ...interface{})

func TimelineBegin

func TimelineBegin(form string, details ...interface{})

func TimelineEnd

func TimelineEnd()

func Trace

func Trace(format string, details ...interface{}) error

func TraceFlag

func TraceFlag() bool

func UnifyStageHandling

func UnifyStageHandling()

func UserAgent

func UserAgent() string

func UserHomeIdentity

func UserHomeIdentity() string

func UsesHolotree

func UsesHolotree() bool

func UvCache

func UvCache() string

func VerboseEnvironmentBuilding

func VerboseEnvironmentBuilding() bool

func WaitLogs

func WaitLogs()

func WarrantyVoided

func WarrantyVoided() bool

func WheelCache

func WheelCache() string

Types

type Commander

type Commander struct {
	// contains filtered or unexported fields
}

func NewCommander

func NewCommander(parts ...string) *Commander

func (*Commander) CLI

func (it *Commander) CLI() []string

func (*Commander) ConditionalFlag

func (it *Commander) ConditionalFlag(condition bool, details ...string) *Commander

func (*Commander) Option

func (it *Commander) Option(name, value string) *Commander

type Diagnoser

type Diagnoser func(category uint64, status, link, form string, details ...interface{})

func (Diagnoser) Fail

func (it Diagnoser) Fail(category uint64, link, form string, details ...interface{})

func (Diagnoser) Fatal

func (it Diagnoser) Fatal(category uint64, link, form string, details ...interface{})

func (Diagnoser) Ok

func (it Diagnoser) Ok(category uint64, form string, details ...interface{})

func (Diagnoser) Warning

func (it Diagnoser) Warning(category uint64, link, form string, details ...interface{})

type DiagnosticCheck

type DiagnosticCheck struct {
	Type     string `json:"type"`
	Category uint64 `json:"category"`
	Status   string `json:"status"`
	Message  string `json:"message"`
	Link     string `json:"url"`
}

type DiagnosticStatus

type DiagnosticStatus struct {
	Details map[string]string  `json:"details"`
	Checks  []*DiagnosticCheck `json:"checks"`
}

func (*DiagnosticStatus) AsJson

func (it *DiagnosticStatus) AsJson() (string, error)

func (*DiagnosticStatus) Counts

func (it *DiagnosticStatus) Counts() (fatal, fail, warning, ok int)

func (*DiagnosticStatus) Diagnose

func (it *DiagnosticStatus) Diagnose(kind string) Diagnoser

type Duration

type Duration time.Duration

func (Duration) Milliseconds

func (it Duration) Milliseconds() int64

func (Duration) Seconds

func (it Duration) Seconds() float64

func (Duration) String

func (it Duration) String() string

func (Duration) Truncate

func (it Duration) Truncate(granularity time.Duration) Duration

type ExitCode

type ExitCode struct {
	Code    int
	Message string
}

func (ExitCode) ShowMessage

func (it ExitCode) ShowMessage()

type Scorecard

type Scorecard interface {
	Start() Scorecard
	Midpoint() Scorecard
	Done() Scorecard
	Score(uint64, int) string
}

func NewScorecard

func NewScorecard() Scorecard

type Verbosity

type Verbosity uint8
const (
	Undefined Verbosity = 0
	Silently  Verbosity = 1
	Normal    Verbosity = 2
	Debugging Verbosity = 3
	Tracing   Verbosity = 4
)

Jump to

Keyboard shortcuts

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