Documentation
¶
Index ¶
Constants ¶
const ( // DefaultResolverTimeout is the default timeout for individual resolver execution. DefaultResolverTimeout = 30 * time.Second // DefaultPhaseTimeout is the default timeout for resolver phase execution. DefaultPhaseTimeout = 5 * time.Minute // DefaultActionTimeout is the default timeout for action execution. DefaultActionTimeout = 5 * time.Minute // DefaultGracePeriod is the default grace period for action cancellation. DefaultGracePeriod = 30 * time.Second )
Timeout defaults
const ( // DefaultHTTPTimeout is the default timeout for HTTP requests. DefaultHTTPTimeout = 30 * time.Second // DefaultHTTPRetryMax is the default maximum number of HTTP retries. DefaultHTTPRetryMax = 3 // DefaultHTTPRetryWaitMinimum is the minimum wait time between HTTP retries. DefaultHTTPRetryWaitMinimum = 1 * time.Second // DefaultHTTPRetryWaitMaximum is the maximum wait time between HTTP retries. DefaultHTTPRetryWaitMaximum = 30 * time.Second // DefaultHTTPCacheTTL is the default TTL for HTTP cache entries. DefaultHTTPCacheTTL = 10 * time.Minute // DefaultHTTPCacheKeyPrefix is the default prefix for HTTP cache keys. DefaultHTTPCacheKeyPrefix = "scafctl:" )
HTTP client defaults
const ( // DefaultMaxCacheFileSize is the maximum size for a single cached file (10MB). DefaultMaxCacheFileSize = 10 * 1024 * 1024 // DefaultMemoryCacheSize is the maximum number of entries in memory caches. DefaultMemoryCacheSize = 1000 // DefaultWarnValueSize is the threshold for warning about large resolver values (1MB). DefaultWarnValueSize = 1024 * 1024 // DefaultMaxValueSize is the maximum allowed resolver value size (10MB). DefaultMaxValueSize = 10 * 1024 * 1024 )
Size limits
const ( // DefaultCELCacheSize is the default size for the CEL program cache. DefaultCELCacheSize = 10000 // DefaultCELCostLimit is the default cost limit for CEL expression evaluation. // Set to 0 to disable cost limiting. DefaultCELCostLimit = 1000000 )
CEL defaults
const ( // DefaultCircuitBreakerMaxFailures is the number of consecutive failures before opening the circuit. DefaultCircuitBreakerMaxFailures = 5 // DefaultCircuitBreakerOpenTimeout is how long to wait before transitioning from Open to HalfOpen. DefaultCircuitBreakerOpenTimeout = 30 * time.Second // DefaultCircuitBreakerHalfOpenRequests is the number of successful requests in HalfOpen before closing. DefaultCircuitBreakerHalfOpenRequests = 1 )
Circuit breaker defaults
const (
CliBinaryName = "scafctl"
)
Variables ¶
var ( RootSolutionFolders = []string{ CliBinaryName, fmt.Sprintf(".%s", CliBinaryName), "", } SolutionFileNames = []string{ "solution.yaml", "solution.yml", fmt.Sprintf("%s.yaml", CliBinaryName), fmt.Sprintf("%s.yml", CliBinaryName), "solution.json", fmt.Sprintf("%s.json", CliBinaryName), } )
var VersionInformation = VersionInfo{
Commit: "unknown",
BuildVersion: "v0.0.0-nightly",
BuildTime: "unknown",
}
Functions ¶
func DefaultHTTPCacheDir ¶
func DefaultHTTPCacheDir() string
DefaultHTTPCacheDir returns the default directory for HTTP cache. Uses XDG Base Directory Specification:
- Linux: ~/.cache/scafctl/http-cache/
- macOS: ~/.cache/scafctl/http-cache/
- Windows: %LOCALAPPDATA%\cache\scafctl\http-cache\
Types ¶
type EntryPointSettings ¶
EntryPointSettings holds configuration options for determining the entry point source. It specifies whether the entry point is provided via an API or CLI, and the path to the entry point.
type Run ¶
type Run struct {
MinLogLevel string
EntryPointSettings EntryPointSettings
IsQuiet bool
NoColor bool
ExitOnError bool
}
Run holds configuration settings for a single execution of the application. It includes options for logging, entry point configuration, output formatting, and error handling behavior.
func FromContext ¶
FromContext retrieves a Settings object from the context
func NewCliParams ¶
func NewCliParams() *Run
NewCliParams initializes and returns a pointer to a Run struct with default CLI parameters. It sets logging level to "none" (no structured logs by default), configures entry point settings for CLI usage, and sets default flags for quiet mode, color output, and error handling.
type VersionInfo ¶
VersionInfo holds metadata about the build, including the commit hash, build version, and build timestamp.