local

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2018 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DraftLabelKey is the label selector key on a pod that allows
	//  us to identify which draft app a pod is associated with
	DraftLabelKey = "draft"

	// BuildIDKey is the label selector key on a pod that specifies
	// the build ID of the application
	BuildIDKey = "buildID"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Name          string
	Namespace     string
	Container     string
	OverridePorts []string
}

App encapsulates information about an application to connect to

Name is the name of the application
Namespace is the Kubernetes namespace it is deployed in
Container is the name the name of the application container to connect to
OverridePorts contains mappings of which local port to map a remote port to
  and will be in the form local_port:remote_port i.e. 8080:8081

func DeployedApplication

func DeployedApplication(draftTomlPath, draftEnvironment string) (*App, error)

DeployedApplication returns deployment information about the deployed instance

of the source code given a path to your draft.toml file and the name of the
draft environment

func (*App) Connect

func (a *App) Connect(clientset kubernetes.Interface, clientConfig *restclient.Config, targetContainer string, overridePorts []string, buildID string) (*Connection, error)

Connect tunnels to a Kubernetes pod running the application and returns the connection information

func (*App) GetPodNames

func (a *App) GetPodNames(buildID string, clientset kubernetes.Interface) ([]string, error)

type Connection

type Connection struct {
	ContainerConnections []*ContainerConnection
	PodName              string
	Clientset            kubernetes.Interface
}

Connection encapsulated information to connect to an application

func (*Connection) RequestLogStream

func (c *Connection) RequestLogStream(namespace string, containerName string, logLines int64) (io.ReadCloser, error)

RequestLogStream returns a stream of the application pod's logs

type ContainerConnection

type ContainerConnection struct {
	Tunnels       []*tunnel.Tunnel
	ContainerName string
}

ContainerConnection encapsulates a connection to a container in a pod

Jump to

Keyboard shortcuts

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