Documentation
¶
Overview ¶
Package mockserver provides a mock Cloudflare API server for testing.
Index ¶
- type Option
- type RequestLogEntry
- type Server
- func (s *Server) ErrorInjector() *injection.ErrorInjector
- func (s *Server) GetRequestCount(pathPrefix string) int
- func (s *Server) GetRequestLog() []RequestLogEntry
- func (s *Server) Reset()
- func (s *Server) Start() error
- func (s *Server) StartAsync() error
- func (s *Server) Stop(ctx context.Context) error
- func (s *Server) Store() *store.Store
- func (s *Server) URL() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RequestLogEntry ¶
RequestLogEntry records an API request.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the mock Cloudflare API server.
func (*Server) ErrorInjector ¶
func (s *Server) ErrorInjector() *injection.ErrorInjector
ErrorInjector returns the server's error injector.
func (*Server) GetRequestCount ¶
GetRequestCount returns the number of requests matching the given path prefix.
func (*Server) GetRequestLog ¶
func (s *Server) GetRequestLog() []RequestLogEntry
GetRequestLog returns a copy of the request log.
func (*Server) StartAsync ¶
StartAsync starts the server in a goroutine and waits for it to be ready.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package main provides the entry point for the mock Cloudflare API server.
|
Package main provides the entry point for the mock Cloudflare API server. |
|
Package handlers provides HTTP handlers for the mock Cloudflare API server.
|
Package handlers provides HTTP handlers for the mock Cloudflare API server. |
|
Package injection provides error injection capabilities for testing.
|
Package injection provides error injection capabilities for testing. |
|
internal
|
|
|
store
Package store provides in-memory storage for the mock Cloudflare API server.
|
Package store provides in-memory storage for the mock Cloudflare API server. |
|
Package models defines the data types for the Cloudflare API mock server.
|
Package models defines the data types for the Cloudflare API mock server. |
Click to show internal directories.
Click to hide internal directories.