Documentation
¶
Index ¶
Constants ¶
const ( // DefaultInterval is the default interval between artifact pulls DefaultInterval = 180 * time.Second // MinimumInterval is the minimum allowed interval between pulls MinimumInterval = 180 * time.Second )
Variables ¶
var ( // DefaultDeadline is the maximum time allowed for a single pull operation DefaultDeadline = 60 * time.Second // DefaultRetryInterval is the time between retry attempts DefaultRetryInterval = 10 * time.Second // DefaultRetryCount is the maximum number of retry attempts DefaultRetryCount = 3 )
var ( // ErrInvalidArtifactIndex is returned when accessing an invalid artifact index ErrInvalidArtifactIndex = errors.New("invalid artifact index") // ErrEmptyURL is returned when the artifact URL is empty ErrEmptyURL = errors.New("empty artifact URL") // ErrEmptyPath is returned when the artifact path is empty ErrEmptyPath = errors.New("empty artifact path") )
Functions ¶
func PullWithRetry ¶
func Start ¶
Start starts the artifact pull process in the background.
To attempt to respect the rate limits of the registry: - the pull operation has 60(DefaultDeadline) seconds to complete. - the pull operation will retry every 10 seconds. - the pull operation will try no more than 3 times. The next pull operation is scheduled after a successful pull at the interval specified in the artifact.
Types ¶
type Artifact ¶
type Artifact struct {
URL string
Interval time.Duration
Path string
// credentials and connection settings
Credential auth.Credential
// contains filtered or unexported fields
}
Artifact represents a single OCI artifact with its configuration and state
func (*Artifact) Prepare ¶
Prepare initializes the artifact by setting up the repository configuration and performing authentication if credentials are provided.
func (*Artifact) Pull ¶
Pull downloads the artifact from the remote repository to the local file system.
func (*Artifact) Repository ¶
Repository returns the repository name from the remote reference