Documentation ¶
Index ¶
- func HaveConnectivityTo(target connectionTarget, explicitPort ...uint16) types.GomegaMatcher
- type ConnectivityChecker
- func (c *ConnectivityChecker) ActualConnectivity() []string
- func (c *ConnectivityChecker) CheckConnectivity(optionalDescription ...interface{})
- func (c *ConnectivityChecker) CheckConnectivityOffset(offset int, optionalDescription ...interface{})
- func (c *ConnectivityChecker) CheckConnectivityWithTimeout(timeout time.Duration, optionalDescription ...interface{})
- func (c *ConnectivityChecker) CheckConnectivityWithTimeoutOffset(callerSkip int, timeout time.Duration, optionalDescription ...interface{})
- func (c *ConnectivityChecker) ExpectNone(from connectionSource, to connectionTarget, explicitPort ...uint16)
- func (c *ConnectivityChecker) ExpectSome(from connectionSource, to connectionTarget, explicitPort ...uint16)
- func (c *ConnectivityChecker) ExpectedConnectivity() []string
- func (c *ConnectivityChecker) ResetExpectations()
- type IP
- type Port
- type Workload
- func (w *Workload) CanConnectTo(ip, port, protocol string) bool
- func (w *Workload) Configure(client client.Interface)
- func (w *Workload) IPNet() string
- func (w *Workload) NameSelector() string
- func (w *Workload) Port(port uint16) *Port
- func (w *Workload) SourceName() string
- func (w *Workload) Stop()
- func (w *Workload) ToMatcher(explicitPort ...uint16) *connectivityMatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HaveConnectivityTo ¶
func HaveConnectivityTo(target connectionTarget, explicitPort ...uint16) types.GomegaMatcher
Types ¶
type ConnectivityChecker ¶
type ConnectivityChecker struct { ReverseDirection bool Protocol string // "tcp" or "udp" // contains filtered or unexported fields }
ConnectivityChecker records a set of connectivity expectations and supports calculating the actual state of the connectivity between the given workloads. It is expected to be used like so:
var cc = &workload.ConnectivityChecker{} cc.ExpectNone(w[2], w[0], 1234) cc.ExpectSome(w[1], w[0], 5678) Eventually(cc.ActualConnectivity, "10s", "100ms").Should(Equal(cc.ExpectedConnectivity()))
Note that the ActualConnectivity method is passed to Eventually as a function pointer to allow Ginkgo to re-evaluate the result as needed.
func (*ConnectivityChecker) ActualConnectivity ¶
func (c *ConnectivityChecker) ActualConnectivity() []string
ActualConnectivity calculates the current connectivity for all the expected paths. One string is returned for each expectation, in the order they were recorded. The strings are intended to be human readable, and they are in the same order and format as those returned by ExpectedConnectivity().
func (*ConnectivityChecker) CheckConnectivity ¶
func (c *ConnectivityChecker) CheckConnectivity(optionalDescription ...interface{})
func (*ConnectivityChecker) CheckConnectivityOffset ¶
func (c *ConnectivityChecker) CheckConnectivityOffset(offset int, optionalDescription ...interface{})
func (*ConnectivityChecker) CheckConnectivityWithTimeout ¶
func (c *ConnectivityChecker) CheckConnectivityWithTimeout(timeout time.Duration, optionalDescription ...interface{})
func (*ConnectivityChecker) CheckConnectivityWithTimeoutOffset ¶
func (c *ConnectivityChecker) CheckConnectivityWithTimeoutOffset(callerSkip int, timeout time.Duration, optionalDescription ...interface{})
func (*ConnectivityChecker) ExpectNone ¶
func (c *ConnectivityChecker) ExpectNone(from connectionSource, to connectionTarget, explicitPort ...uint16)
func (*ConnectivityChecker) ExpectSome ¶
func (c *ConnectivityChecker) ExpectSome(from connectionSource, to connectionTarget, explicitPort ...uint16)
func (*ConnectivityChecker) ExpectedConnectivity ¶
func (c *ConnectivityChecker) ExpectedConnectivity() []string
ExpectedConnectivity returns one string per recorded expection in order, encoding the expected connectivity in the same format used by ActualConnectivity().
func (*ConnectivityChecker) ResetExpectations ¶
func (c *ConnectivityChecker) ResetExpectations()
type Workload ¶
type Workload struct { C *containers.Container Name string InterfaceName string IP string Ports string DefaultPort string WorkloadEndpoint *api.WorkloadEndpoint Protocol string // "tcp" or "udp" // contains filtered or unexported fields }
func Run ¶
func Run(c *containers.Container, name, interfaceName, ip, ports string, protocol string) (w *Workload)