Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertError ¶ added in v1.0.7
AssertError asserts that an error matches the expected error string. If wantErr is empty, it expects no error. Otherwise, it expects the error message to exactly match wantErr.
func CheckForUpdates ¶
func CheckForUpdates( ctx context.Context, debugLog *log.Logger, g ContainerAPIMetadataGetter, inUse Semver, )
Example ¶
defer func(w io.Writer, flags int, p string) {
log.SetOutput(w)
log.SetFlags(flags)
log.SetPrefix(p)
}(log.Writer(), log.Flags(), log.Prefix())
log.SetOutput(os.Stdout)
log.SetFlags(0)
log.SetPrefix("[logger] ")
debugLog := log.New(log.Writer(), log.Prefix(), log.Flags())
ctx := context.Background()
CheckForUpdates(ctx, debugLog, fakeContainerAPIMetadataGetter("1.4.33"), "v1.4.33")
CheckForUpdates(ctx, debugLog, fakeContainerAPIMetadataGetter("very bad error occurred"), "v1.4.33")
fmt.Println("now we should get warnings")
CheckForUpdates(ctx, debugLog, fakeContainerAPIMetadataGetter("v1.6.11"), "v1.4.33")
CheckForUpdates(ctx, debugLog, fakeContainerAPIMetadataGetter("v2.7.3"), "v2.7.3-beta")
Output: [logger] could not get latest lightsailctl version: very bad error occurred now we should get warnings [logger] WARNING: You are using lightsailctl v1.4.33, but v1.6.11 is available. To download, visit https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-install-software [logger] WARNING: You are using lightsailctl v2.7.3-beta, but v2.7.3 is available. To download, visit https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-install-software
Types ¶
type ContainerAPIMetadataGetter ¶
type ContainerAPIMetadataGetter interface {
GetContainerAPIMetadata(
context.Context,
*lightsail.GetContainerAPIMetadataInput,
...func(*lightsail.Options),
) (*lightsail.GetContainerAPIMetadataOutput, error)
}
Directories
¶
| Path | Synopsis |
|---|---|
|
Package cs implements features related to Lightsail (C)ontainer (S)ervice.
|
Package cs implements features related to Lightsail (C)ontainer (S)ervice. |
|
Package plugin implements extensions for AWS CLI's lightsail subcommand.
|
Package plugin implements extensions for AWS CLI's lightsail subcommand. |
Click to show internal directories.
Click to hide internal directories.