Documentation ¶
Overview ¶
Package broker implements the cloud broker.
Package broker implements the cloud broker.
Index ¶
- Constants
- Variables
- func BrokerPortFromEnv() int
- func KillProcessTree(cmd *exec.Cmd) error
- func New() *server
- func NewGrpcServer(host string, port int, brokerDir string, config *emulators.BrokerConfig, ...) (*grpcServer, error)
- func RegisterWithBroker(ruleId string, address string, additionalTargetPatterns []string, ...) error
- func RunProcessTree(cmd *exec.Cmd) error
- func StartProcessTree(cmd *exec.Cmd) error
- type ClientConnection
- type FreePortPicker
- type PortPicker
- type PortRangePicker
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 ¶
Kills the process tree associated with the command.
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 ¶
Runs the command, and waits for completion.
func StartProcessTree ¶
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 ¶
type FreePortPicker ¶
type FreePortPicker struct{}
type PortPicker ¶
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)
Click to show internal directories.
Click to hide internal directories.