Documentation ¶
Index ¶
- func NewHttpServer(mux *http.ServeMux) (server *httptest.Server)
- func NewHttpsServer(mux *http.ServeMux) (server *httptest.Server)
- func NewSecondaryProxy(s *HttpServers) (net.Listener, string)
- type ConstantCacheHandler
- type ConstantHandler
- type ConstantSlowHandler
- type GrpcServiceMock
- func (s *GrpcServiceMock) Clear()
- func (s *GrpcServiceMock) Close()
- func (s *GrpcServiceMock) Do(server browsercontrollerV1.BrowserController_DoServer) error
- func (s *GrpcServiceMock) Resolve(ctx context.Context, in *dnsresolverV1.ResolveRequest) (*dnsresolverV1.ResolveReply, error)
- func (s *GrpcServiceMock) Write(server contentwriterV1.ContentWriter_WriteServer) error
- type HttpServers
- type MockOption
- type Requests
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSecondaryProxy ¶
func NewSecondaryProxy(s *HttpServers) (net.Listener, string)
Types ¶
type ConstantCacheHandler ¶
type ConstantCacheHandler string
func (ConstantCacheHandler) ServeHTTP ¶
func (h ConstantCacheHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ConstantHandler ¶
type ConstantHandler string
func (ConstantHandler) ServeHTTP ¶
func (h ConstantHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ConstantSlowHandler ¶
type ConstantSlowHandler struct {
// contains filtered or unexported fields
}
func NewConstantSlowHandler ¶
func NewConstantSlowHandler(response string, waitMillis int) *ConstantSlowHandler
func (ConstantSlowHandler) ServeHTTP ¶
func (h ConstantSlowHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type GrpcServiceMock ¶
type GrpcServiceMock struct { dnsresolverV1.UnimplementedDnsResolverServer contentwriterV1.UnimplementedContentWriterServer browsercontrollerV1.UnimplementedBrowserControllerServer Requests *Requests DoneBC chan bool DoneCW chan bool Server *grpc.Server ClientConn *serviceconnections.Connections // contains filtered or unexported fields }
*
- Server mocks
func NewGrpcServiceMock ¶
func NewGrpcServiceMock(opts ...MockOption) *GrpcServiceMock
func (*GrpcServiceMock) Clear ¶
func (s *GrpcServiceMock) Clear()
func (*GrpcServiceMock) Close ¶
func (s *GrpcServiceMock) Close()
func (*GrpcServiceMock) Do ¶
func (s *GrpcServiceMock) Do(server browsercontrollerV1.BrowserController_DoServer) error
Implements BrowserController
func (*GrpcServiceMock) Resolve ¶
func (s *GrpcServiceMock) Resolve(ctx context.Context, in *dnsresolverV1.ResolveRequest) (*dnsresolverV1.ResolveReply, error)
Implements DNS service
func (*GrpcServiceMock) Write ¶
func (s *GrpcServiceMock) Write(server contentwriterV1.ContentWriter_WriteServer) error
Implements ContentWriterService
type HttpServers ¶
type HttpServers struct { SrvHttp *httptest.Server SrvHttps *httptest.Server SrvHttpsBadCert *httptest.Server // contains filtered or unexported fields }
HttpServers contains test servers for HTTP and HTTPS
func NewHttpServers ¶
func NewHttpServers() *HttpServers
func (*HttpServers) Close ¶
func (s *HttpServers) Close()
type MockOption ¶
type MockOption interface {
// contains filtered or unexported methods
}
ConnectionOption configures how we parse a URL.
func WithExternalBrowserController ¶
func WithExternalBrowserController(option *serviceconnections.ConnectionOptions) MockOption
func WithExternalContentWriter ¶
func WithExternalContentWriter(option *serviceconnections.ConnectionOptions) MockOption
func WithExternalDns ¶
func WithExternalDns(option *serviceconnections.ConnectionOptions) MockOption
type Requests ¶
type Requests struct { BrowserControllerRequests []*browsercontrollerV1.DoRequest DnsResolverRequests []*dnsresolverV1.ResolveRequest ContentWriterRequests []*contentwriterV1.WriteRequest }
Click to show internal directories.
Click to hide internal directories.