module

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const REPO_DIR = "repos"

Variables

View Source
var DefaultTimeoutConfig = GetDefaultModuleTimeoutOptions()

DefaultTimeoutConfig provides default values for all timeouts

View Source
var TimeoutConfig = DefaultTimeoutConfig

Current timeout configuration, can be modified at runtime

Functions

func CheckModuleOptions

func CheckModuleOptions(options data.ModuleConfig) error

func CloneModule

func CloneModule(module data.ModuleConfig) (*git.Repository, error)

func ConfigureTimeouts

func ConfigureTimeouts(config ModuleTimeoutConfig)

ConfigureTimeouts allows users to modify the timeout configuration Partial configurations are supported - only the provided fields will be updated

func LoadModule

func LoadModule(module data.ModuleConfig, inputs map[string]string) (*data.Module, error)

- prepare the module - now we have the text of the template - inject the given values using template syntax - JSON parse and check we don't have errors

func PrepareModule

func PrepareModule(module data.ModuleConfig) (string, error)

PrepareModule get a module cloned and checked out then return the text content of the template

  • process shortcuts
  • check if we have the repo cloned
  • checkout the correct hash
  • check and read the file

func ProcessModule

func ProcessModule(module data.ModuleConfig) (data.ModuleConfig, error)

given a module - check if it's a shortcut and if yes expand the shortcut into the other module props

func ResetTimeouts

func ResetTimeouts()

ResetTimeouts resets all timeouts to default values

Types

type ModuleTimeoutConfig

type ModuleTimeoutConfig struct {
	// Lock related timeouts
	DefaultLockTimeout  time.Duration // Default timeout for acquiring lock
	ExtendedLockTimeout time.Duration // Extended timeout for lock acquisition during clone
	LockTickInterval    time.Duration // Interval between lock acquisition attempts
	StaleLockThreshold  time.Duration // Time after which a lock is considered stale

	// Git operation related timeouts and retries
	MaxRetries             int           // Maximum number of retries for git operations
	RetryDelayMultiplier   time.Duration // Base delay multiplier for retries
	NetworkRetryMultiplier time.Duration // Additional delay for network-related errors
}

ModuleTimeoutConfig holds all timeout configuration values

func GetDefaultModuleTimeoutOptions

func GetDefaultModuleTimeoutOptions() ModuleTimeoutConfig

GetDefaultModuleTimeoutOptions returns default options from environment variables or hardcoded defaults

type RefCache

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

func NewRefCache

func NewRefCache() *RefCache

func (*RefCache) Get

func (rc *RefCache) Get(repoURL, reference string) string

func (*RefCache) Set

func (rc *RefCache) Set(repoURL, reference, commitHash string)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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