Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPClient ¶
HTTPClient returns an *http.Client, URL, and cleanup function. The http.Client is configured to connect to test SSL Server at the returned URL. This server will respond to HTTP requests defined, or return a 5xx server error for unexpected ones. The cleanup function will close the server, and return an error if any expected calls weren't received.
func StartServerProxy ¶
func StartServerProxy(t *testing.T, inst FakeAlloyDBInstance) func()
StartServerProxy starts a fake server proxy and listens on the provided port on all interfaces, configured with TLS as specified by the FakeAlloyDBInstance. Callers should invoke the returned function to clean up all resources.
Types ¶
type FakeAlloyDBInstance ¶
type FakeAlloyDBInstance struct {
// contains filtered or unexported fields
}
func NewFakeInstance ¶
func NewFakeInstance(proj, reg, clust, name string, opts ...Option) FakeAlloyDBInstance
type Option ¶
type Option func(*FakeAlloyDBInstance)
func WithCertExpiry ¶
func WithIPAddr ¶
func WithServerName ¶ added in v0.2.0
type Request ¶
Request represents a HTTP request for a test Server to mock responses for.
Use NewRequest to initialize new Requests.
func CreateEphemeralSuccess ¶
func CreateEphemeralSuccess(i FakeAlloyDBInstance, ct int) *Request
CreateEphemeralSuccess returns a Request that responds to the `generateEphemeralCert` AlloyDB Admin API endpoint.
func InstanceGetSuccess ¶
func InstanceGetSuccess(i FakeAlloyDBInstance, ct int) *Request
InstanceGetSuccess returns a Request that responds to the `instance.get` AlloyDB Admin API endpoint.