framework

package
v0.30.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestCAFile         = "anp-test-ca.crt"
	TestServerCertFile = "anp-test-server.crt"
	TestServerKeyFile  = "anp-test-server.key"
	TestAgentCertFile  = "anp-test-agent.crt"
	TestAgentKeyFile   = "anp-test-agent.key"
)

Variables

View Source
var CertsDir string // Initialized with InitCertsDir

Functions

func FreePorts

func FreePorts(count int) ([]int, error)

FreePorts finds [count] available ports.

func InitCertsDir

func InitCertsDir() error

InitCertsDir writes the above certificates & keys to a temporary directory.

Types

type Agent

type Agent interface {
	GetConnectedServerCount() (int, error)
	Ready() bool
	Stop()
	Metrics() metricstest.AgentTester
}

type AgentOpts

type AgentOpts struct {
	AgentID    string
	ServerAddr string
}

type AgentRunner

type AgentRunner interface {
	Start(testing.TB, AgentOpts) (Agent, error)
}

type ExternalAgentRunner added in v0.30.0

type ExternalAgentRunner struct {
	ExecutablePath string
}

func (*ExternalAgentRunner) Start added in v0.30.0

func (r *ExternalAgentRunner) Start(t testing.TB, opts AgentOpts) (Agent, error)

type Framework

type Framework struct {
	AgentRunner       AgentRunner
	ProxyServerRunner ProxyServerRunner
}

type InProcessAgentRunner

type InProcessAgentRunner struct{}

func (*InProcessAgentRunner) Start

func (*InProcessAgentRunner) Start(t testing.TB, opts AgentOpts) (Agent, error)

type InProcessProxyServerRunner

type InProcessProxyServerRunner struct{}

func (*InProcessProxyServerRunner) Start

type ProxyServer

type ProxyServer interface {
	ConnectedBackends() (int, error)
	AgentAddr() string
	FrontAddr() string
	Ready() bool
	Stop()
	Metrics() metricstest.ServerTester
}

type ProxyServerOpts

type ProxyServerOpts struct {
	ServerCount int
	Mode        string
	AgentPort   int // Defaults to random port.
}

type ProxyServerRunner

type ProxyServerRunner interface {
	Start(testing.TB, ProxyServerOpts) (ProxyServer, error)
}

Jump to

Keyboard shortcuts

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