Documentation ¶
Index ¶
- Constants
- func CreateCert(cname string) tls.Certificate
- func CreateCertDER(cname string) (*rsa.PrivateKey, []byte)
- func CreateECKeyPair(cname string) (keyPEM, certPEM []byte)
- func CreateKeyPair(cname string) (keyPEM, certPEM []byte)
- func CreateKeyPairFromDER(certDER []byte, privKey *rsa.PrivateKey) (keyPEM, certPEM []byte)
- func CustomSpecSSLConfig(onlyTrustClientCACerts bool, TLSClientConfigOption int, ...) (*config.Config, *tls.Config)
- func NewFakeMetron() *fakeMetron
- func NewRequest(method, host, rawPath string, body io.Reader) *http.Request
- func NewResponse(status int) *http.Response
- func NextAvailPort() uint16
- func RegisterAddr(reg *registry.RouteRegistry, path string, addr string, cfg RegisterConfig)
- func RegisterConnHandler(reg *registry.RouteRegistry, path string, handler connHandler, ...) net.Listener
- func RegisterHTTPHandler(reg *registry.RouteRegistry, path string, handler http.HandlerFunc, ...) net.Listener
- func RegisterWSHandler(reg *registry.RouteRegistry, path string, handler websocket.Handler, ...) net.Listener
- func SpecConfig(...) *config.Config
- func SpecSSLConfig(statusPort, statusTLSPort, statusRoutesPort, proxyPort, SSLPort, ... uint16, ...) (*config.Config, *tls.Config)
- type CertChain
- type CertNames
- type Event
- type FailureReporter
- func (fr FailureReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)
- func (fr FailureReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary)
- func (fr FailureReporter) SpecDidComplete(ss *types.SpecSummary)
- func (fr FailureReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)
- func (fr FailureReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
- func (fr FailureReporter) SpecWillRun(specSummary *types.SpecSummary)
- func (fr FailureReporter) SuiteDidEnd(summary *types.SuiteSummary)
- func (fr FailureReporter) SuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
- type FakeFile
- type FakeMetron
- type HangingReadCloser
- type HttpConn
- func (x *HttpConn) CheckLine(expected string)
- func (x *HttpConn) CheckLines(expected []string)
- func (x *HttpConn) ReadRequest() (*http.Request, string)
- func (x *HttpConn) ReadResponse() (*http.Response, string)
- func (x *HttpConn) WriteLine(line string) error
- func (x *HttpConn) WriteLines(lines []string) error
- func (x *HttpConn) WriteRequest(req *http.Request)
- func (x *HttpConn) WriteResponse(resp *http.Response)
- type NATSRunner
- type Nats
- type RegisterConfig
- type SlowReadCloser
- type SubjectAltNames
- type TestLogger
- type TestSink
Constants ¶
View Source
const ( TLSConfigFromCACerts = 1 TLSConfigFromClientCACerts = 2 TLSConfigFromUnknownCA = 3 )
View Source
const LocalhostDNS = "localhost.routing.cf-app.com"
Our tests assume that there exists a DNS entry *.localhost.routing.cf-app.com that maps to 127.0.0.1 If that DNS entry does not work, then many, many tests will fail
Variables ¶
This section is empty.
Functions ¶
func CreateCert ¶
func CreateCert(cname string) tls.Certificate
func CreateCertDER ¶
func CreateCertDER(cname string) (*rsa.PrivateKey, []byte)
func CreateECKeyPair ¶
func CreateKeyPair ¶
func CreateKeyPairFromDER ¶
func CreateKeyPairFromDER(certDER []byte, privKey *rsa.PrivateKey) (keyPEM, certPEM []byte)
func CustomSpecSSLConfig ¶
func NewFakeMetron ¶
func NewFakeMetron() *fakeMetron
func NewResponse ¶
func NextAvailPort ¶
func NextAvailPort() uint16
func RegisterAddr ¶
func RegisterAddr(reg *registry.RouteRegistry, path string, addr string, cfg RegisterConfig)
func RegisterConnHandler ¶
func RegisterConnHandler(reg *registry.RouteRegistry, path string, handler connHandler, cfg ...RegisterConfig) net.Listener
func RegisterHTTPHandler ¶
func RegisterHTTPHandler(reg *registry.RouteRegistry, path string, handler http.HandlerFunc, cfg ...RegisterConfig) net.Listener
func RegisterWSHandler ¶
func RegisterWSHandler(reg *registry.RouteRegistry, path string, handler websocket.Handler, cfg ...RegisterConfig) net.Listener
func SpecConfig ¶
Types ¶
type CertChain ¶
type CertChain struct {
CertPEM, CACertPEM []byte
PrivKeyPEM, CAPrivKeyPEM []byte
CACert *x509.Certificate
CAPrivKey *rsa.PrivateKey
}
func CreateCertAndAddCA ¶
CreateCertAndAddCA creates a signed cert with a root CA and adds the CA to the specified cert pool
func (*CertChain) AsTLSConfig ¶
func (*CertChain) TLSCert ¶
func (c *CertChain) TLSCert() tls.Certificate
func (*CertChain) WriteCACertToDir ¶
type CertNames ¶
type CertNames struct { CommonName string SANs SubjectAltNames }
type FailureReporter ¶
type FailureReporter struct {
// contains filtered or unexported fields
}
func NewFailureReporter ¶
func NewFailureReporter(client client.Client) FailureReporter
func (FailureReporter) AfterSuiteDidRun ¶
func (fr FailureReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)
func (FailureReporter) BeforeSuiteDidRun ¶
func (fr FailureReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary)
func (FailureReporter) SpecDidComplete ¶
func (fr FailureReporter) SpecDidComplete(ss *types.SpecSummary)
func (FailureReporter) SpecSuiteDidEnd ¶
func (fr FailureReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)
func (FailureReporter) SpecSuiteWillBegin ¶
func (fr FailureReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
func (FailureReporter) SpecWillRun ¶
func (fr FailureReporter) SpecWillRun(specSummary *types.SpecSummary)
func (FailureReporter) SuiteDidEnd ¶
func (fr FailureReporter) SuiteDidEnd(summary *types.SuiteSummary)
func (FailureReporter) SuiteWillBegin ¶
func (fr FailureReporter) SuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
type FakeMetron ¶
type HangingReadCloser ¶
type HangingReadCloser struct {
// contains filtered or unexported fields
}
func (*HangingReadCloser) Close ¶
func (h *HangingReadCloser) Close() error
type HttpConn ¶
func NewHttpConn ¶
func (*HttpConn) CheckLines ¶
func (*HttpConn) WriteLines ¶
func (*HttpConn) WriteRequest ¶
func (*HttpConn) WriteResponse ¶
type NATSRunner ¶
type NATSRunner struct { MessageBus *nats.Conn // contains filtered or unexported fields }
func NewNATSRunner ¶
func NewNATSRunner(port int) *NATSRunner
func (*NATSRunner) KillWithFire ¶
func (runner *NATSRunner) KillWithFire()
func (*NATSRunner) Start ¶
func (runner *NATSRunner) Start()
func (*NATSRunner) Stop ¶
func (runner *NATSRunner) Stop()
type RegisterConfig ¶
type SlowReadCloser ¶
type SlowReadCloser struct { SleepDuration time.Duration // contains filtered or unexported fields }
func (*SlowReadCloser) Close ¶
func (h *SlowReadCloser) Close() error
type SubjectAltNames ¶
type TestLogger ¶
TestLogger implements an slog logger that can be used with Ginkgo tests
func NewTestLogger ¶
func NewTestLogger(component string) *TestLogger
NewTestLogger returns a new slog logger using a zap handler
func (*TestLogger) Buffer ¶
func (z *TestLogger) Buffer() *gbytes.Buffer
Buffer returns the gbytes buffer that was used as the sink
Source Files ¶
Click to show internal directories.
Click to hide internal directories.