Documentation
¶
Overview ¶
Package proxy contains the implementation of the proxy used to record traffic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TakeSnapshot ¶
func TakeSnapshot( requestID int, graphQLRequest GraphQLRequest, snapshotter Snapshotter, rec recorder.RecorderSaver, reporter Reporter, ) error
Types ¶
type GraphQLRequest ¶
type GraphQLRequest struct { OperationName string `json:"operationName"` Variables map[string]interface{} `json:"variables"` Query string `json:"query"` // Set after the operation is parsed OperationType OperationType `json:"-"` }
func ParseRequest ¶
func ParseRequest(content []byte) (GraphQLRequest, error)
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func NewHandler( host string, endpoint string, snapshotter Snapshotter, rec recorder.RecorderSaver, selector RequestSelector, reporter Reporter, requestInfoChan chan RequestInfo, ) (*Handler, error)
func (*Handler) ProxyDirector ¶
func (*Handler) ProxyResponseHandler ¶
type OperationType ¶
type OperationType string
const ( OperationTypeUnknown OperationType = "unknown" OperationTypeQuery OperationType = "query" OperationTypeMutation OperationType = "mutation" )
type RequestInfo ¶
type RequestInfo struct { RequestID int `json:"requestID"` OperationType OperationType `json:"operationType"` OperationName string `json:"operationName"` WillSnapshot bool `json:"willSnapshot"` ShapshotComplete bool `json:"snapshotComplete"` }
type RequestSelector ¶
type RequestSelector interface { ShouldRecordRequest(r GraphQLRequest) bool ShouldSnapshotRequest(r GraphQLRequest) bool }
type Snapshotter ¶
type Snapshotter interface { TakeSnapshot(r GraphQLRequest) ([]byte, error) SnapshotInfo() string }
Click to show internal directories.
Click to hide internal directories.