externalservice

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DeploymentName = "externalservice-"
	HttpServer     = "http-server"
	HttpsServer    = "https-server"
	TcpSink        = "tcp-sink"
)

Variables

View Source
var ExternalServiceCommand = func(port uint32, message string) Command {
	return []string{"ncat", "-lk", "-p", fmt.Sprintf("%d", port), "--sh-exec",
		fmt.Sprintf("'echo \"HTTP/1.1 200 OK\n\n%s\n\"'", message)}
}
View Source
var UniversalAppEchoServer = ExternalServiceCommand(80, "Echo 80")
View Source
var UniversalAppHttpsEchoServer = Command([]string{"ncat",
	"-lk", "-p", "443",
	"--ssl", "--ssl-cert", "/server-cert.pem", "--ssl-key", "/server-key.pem",
	"--sh-exec", "'echo \"HTTP/1.1 200 OK\n\n HTTPS Echo\n\"'"})
View Source
var UniversalEchoServer = func(port int, tls bool) Command {
	args := []string{
		"test-server", "echo",
		"--instance", fmt.Sprintf("echo-%d", port),
		"--port", fmt.Sprintf("%d", port),
	}
	if tls {
		args = append(args, "--crt", "/server-cert.pem", "--key", "/server-key.pem", "--tls")
	}
	return args
}
View Source
var UniversalTCPSink = Command([]string{"ncat", "-lk", "9999", ">", "/nc.out"})

Functions

func Install

func Install(name string, commands ...Command) framework.InstallFunc

Types

type Command added in v1.8.1

type Command []string

type Deployment

type Deployment interface {
	framework.Deployment
	ExternalService
}

type ExternalService

type ExternalService interface {
	GetExternalAppAddress() string
	GetCert() string
}

func From

func From(cluster framework.Cluster, name string) ExternalService

type UniversalDeployment added in v1.8.1

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

func (*UniversalDeployment) Delete added in v1.8.1

func (u *UniversalDeployment) Delete(cluster framework.Cluster) error

func (*UniversalDeployment) Deploy added in v1.8.1

func (u *UniversalDeployment) Deploy(cluster framework.Cluster) error

func (*UniversalDeployment) Exec added in v1.8.1

func (u *UniversalDeployment) Exec(cmd ...string) (string, string, error)

func (*UniversalDeployment) GetCert added in v1.8.1

func (u *UniversalDeployment) GetCert() string

func (*UniversalDeployment) GetExternalAppAddress added in v1.8.1

func (u *UniversalDeployment) GetExternalAppAddress() string

func (*UniversalDeployment) GetExternalPort added in v1.8.1

func (u *UniversalDeployment) GetExternalPort(internalPort uint32) (uint32, bool)

func (*UniversalDeployment) Name added in v1.8.1

func (u *UniversalDeployment) Name() string

Jump to

Keyboard shortcuts

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