Documentation
¶
Index ¶
- Constants
- Variables
- func CountFailedUpdates(cfg *compose.Config, clientRef string) (int, error)
- func GetFetchProgressPrinter(options ...ProgressPrinterOption) func(status *compose.FetchProgress)
- func GetInitProgressPrinter() func(status *InitProgress)
- func GetInstallProgressPrinter(options ...ProgressPrinterOption) func(status *compose.InstallProgress)
- type CompleteOpt
- type CompleteOpts
- type InitOption
- type InitOptions
- type InitProgress
- type InitProgressFunc
- type InitState
- type ProgressPrinterOption
- type ProgressPrinterOpts
- type Runner
- type State
- type Update
Constants ¶
View Source
const (
UpdatesBucketName = "updates"
)
Variables ¶
View Source
var (
ErrUpdateNotFound = errors.New("Update not found")
)
Functions ¶
func CountFailedUpdates ¶
func GetFetchProgressPrinter ¶
func GetFetchProgressPrinter(options ...ProgressPrinterOption) func(status *compose.FetchProgress)
func GetInitProgressPrinter ¶
func GetInitProgressPrinter() func(status *InitProgress)
func GetInstallProgressPrinter ¶
func GetInstallProgressPrinter(options ...ProgressPrinterOption) func(status *compose.InstallProgress)
Types ¶
type CompleteOpt ¶
type CompleteOpt func(*CompleteOpts)
func CompleteWithForce ¶
func CompleteWithForce() CompleteOpt
func CompleteWithPruning ¶
func CompleteWithPruning() CompleteOpt
type CompleteOpts ¶
type InitOption ¶
type InitOption func(options *InitOptions)
func WithInitAllowEmptyAppList ¶
func WithInitAllowEmptyAppList(allowEmptyList bool) InitOption
func WithInitCheckStatus ¶
func WithInitCheckStatus(checkStatus bool) InitOption
func WithInitProgress ¶
func WithInitProgress(pf InitProgressFunc) InitOption
type InitOptions ¶
type InitOptions struct {
ProgressReporter progress.Reporter[InitProgress]
AllowEmptyAppList bool // Allow specifying an empty app list, which means updating to "no apps" state, hence removing all current apps.
CheckStatus bool // Check the status of the specified apps and move the update state to the state that corresponds to this status.
}
type InitProgress ¶
type InitProgressFunc ¶
type InitProgressFunc func(initProgress *InitProgress)
type ProgressPrinterOption ¶
type ProgressPrinterOption func(*ProgressPrinterOpts)
func WithIndentation ¶
func WithIndentation(indentation int) ProgressPrinterOption
type ProgressPrinterOpts ¶
type ProgressPrinterOpts struct {
// Indentation specifies the number of spaces to indent each line
Indentation int
}
type Runner ¶
type Runner interface {
Status() Update
Init(context.Context, []string, ...InitOption) error
Fetch(context.Context, ...compose.FetchOption) error
Install(context.Context, ...compose.InstallOption) error
Start(context.Context, ...compose.StartOption) error
Cancel(context.Context) error
Complete(context.Context, ...CompleteOpt) error
}
type State ¶
type State string
const ( StateCreated State = "update:state:created" StateInitializing State = "update:state:initializing" StateInitialized State = "update:state:initialized" StateFetching State = "update:state:fetching" StateFetched State = "update:state:fetched" StateInstalling State = "update:state:installing" StateInstalled State = "update:state:installed" StateStarting State = "update:state:starting" StateStarted State = "update:state:started" StateCompleting State = "update:state:completing" StateCompleted State = "update:state:completed" StateFailed State = "update:state:failed" StateCancelling State = "update:state:cancelling" StateCanceled State = "update:state:canceled" )
type Update ¶
type Update struct {
ID string `json:"id"`
ClientRef string `json:"client_ref"`
State State `json:"state"`
Progress int `json:"progress"`
CreationTime time.Time `json:"creation_time"`
InitTime time.Time `json:"init_time"`
FetchTime time.Time `json:"fetch_time"`
UpdateTime time.Time `json:"update_time"`
URIs []string `json:"uris"`
Blobs compose.BlobsFetchProgress `json:"blobs"`
TotalBlobsBytes int64 `json:"total_blobs_bytes"` // total size of all blobs in bytes
LoadedImages map[string]struct{} `json:"loaded_images"` // images that have been loaded into the docker storage
FetchedBytes int64 `json:"fetched_bytes"` // total bytes fetched so far
FetchedBlobs int `json:"fetched_blobs"` // number of blobs fetched so far
}
Click to show internal directories.
Click to hide internal directories.