broker

package
v0.0.0-...-3ce974f Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2016 License: Apache-2.0 Imports: 29 Imported by: 3

Documentation

Overview

Package broker implements the cloud broker.

Package broker implements the cloud broker.

Index

Constants

View Source
const (
	// The name of the environment variable with the broker's address.
	BrokerAddressEnv = "TESTENV_BROKER_ADDRESS"
)

Variables

View Source
var (
	EmptyPb = &pb.Empty{}
)

Functions

func BrokerPortFromEnv

func BrokerPortFromEnv() int

Returns the broker port from BrokerAddressEnv, or 0.

func KillProcessTree

func KillProcessTree(cmd *exec.Cmd) error

Kills the process tree associated with the command.

func New

func New() *server

func NewGrpcServer

func NewGrpcServer(host string, port int, brokerDir string, config *emulators.BrokerConfig, opts ...grpc.ServerOption) (*grpcServer, error)

NewGrpcServer returns a Broker service gRPC and HTTP/Json server listening on the specified port.

func RegisterWithBroker

func RegisterWithBroker(ruleId string, address string, additionalTargetPatterns []string, timeout time.Duration) error

Shortcut

func RunProcessTree

func RunProcessTree(cmd *exec.Cmd) error

Runs the command, and waits for completion.

func StartProcessTree

func StartProcessTree(cmd *exec.Cmd) error

Starts the command without waiting for completion.

Types

type ClientConnection

type ClientConnection struct {
	emulators.BrokerClient
	// contains filtered or unexported fields
}

func NewClientConnection

func NewClientConnection(timeout time.Duration) (*ClientConnection, error)

func (*ClientConnection) Close

func (c *ClientConnection) Close() error

func (*ClientConnection) RegisterWithBroker

func (c *ClientConnection) RegisterWithBroker(ruleId string, address string, additionalTargetPatterns []string, timeout time.Duration) error

type FreePortPicker

type FreePortPicker struct{}

func (*FreePortPicker) Next

func (p *FreePortPicker) Next() (int, error)

Picks free ports.

type PortPicker

type PortPicker interface {
	// Returns the next free port.
	Next() (int, error)
}

type PortRangePicker

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

Picks ports from a list of non-overlapping PortRange values.

func NewPortRangePicker

func NewPortRangePicker(ranges []*emulators.PortRange) (*PortRangePicker, error)

func (*PortRangePicker) Next

func (p *PortRangePicker) Next() (int, error)

Jump to

Keyboard shortcuts

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