Documentation ¶
Index ¶
- func Bench(b *testing.B, cfg *Config, f func(b *testing.B, xEnv *Environment))
- func Run(t *testing.T, cfg *Config, f func(t *testing.T, xEnv *Environment))
- type Config
- type Environment
- func (e *Environment) AbsintheSubscriptionURL() string
- func (e *Environment) AbsintheWebsocketDialWithRetry(header http.Header) (*websocket.Conn, *http.Response, error)
- func (e *Environment) GraphQLRequestURL() string
- func (e *Environment) GraphQLServeSentEventsURL() string
- func (e *Environment) GraphQLSubscriptionURL() string
- func (e *Environment) GraphQLWebsocketDialWithRetry(header http.Header) (*websocket.Conn, *http.Response, error)
- func (e *Environment) InitAbsintheWebSocketConnection(header http.Header, initialPayload json.RawMessage) *websocket.Conn
- func (e *Environment) InitGraphQLWebSocketConnection(header http.Header, initialPayload json.RawMessage) *websocket.Conn
- func (e *Environment) MakeGraphQLRequest(request GraphQLRequest) (*TestResponse, error)
- func (e *Environment) MakeGraphQLRequestOK(request GraphQLRequest) *TestResponse
- func (e *Environment) MakeRequest(method, path string, header http.Header, body io.Reader) (*http.Response, error)
- func (e *Environment) SetExtraURLQueryValues(values url.Values)
- func (e *Environment) Shutdown()
- func (e *Environment) WaitForConnectionCount(desiredCount uint64, timeout time.Duration)
- func (e *Environment) WaitForMessagesSent(desiredCount uint64, timeout time.Duration)
- func (e *Environment) WaitForServer(ctx context.Context, url string, timeoutMs int, maxAttempts int)
- func (e *Environment) WaitForSubscriptionCount(desiredCount uint64, timeout time.Duration)
- func (e *Environment) WaitForTriggerCount(desiredCount uint64, timeout time.Duration)
- type GraphQLError
- type GraphQLRequest
- type GraphQLResponse
- type NatsData
- type Subgraph
- type SubgraphConfig
- type SubgraphRequestCount
- type SubgraphsConfig
- type TestResponse
- type WebSocketMessage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { Subgraphs SubgraphsConfig RouterOptions []core.Option OverrideGraphQLPath string OverrideAbsinthePath string ModifyRouterConfig func(routerConfig *nodev1.RouterConfig) ModifyEngineExecutionConfiguration func(engineExecutionConfiguration *config.EngineExecutionConfiguration) ModifySecurityConfiguration func(securityConfiguration *config.SecurityConfiguration) ModifySubgraphErrorPropagation func(subgraphErrorPropagation *config.SubgraphErrorPropagationConfiguration) ModifyCDNConfig func(cdnConfig *config.CDNConfiguration) DisableWebSockets bool TLSConfig *core.TlsConfig TraceExporter trace.SpanExporter MetricReader metric.Reader PrometheusRegistry *prometheus.Registry }
type Environment ¶
type Environment struct { Context context.Context Router *core.Router RouterURL string RouterClient *http.Client Servers []*httptest.Server CDN *httptest.Server NatsServer *natsserver.Server NatsConnectionDefault *nats.Conn NatsConnectionMyNats *nats.Conn SubgraphRequestCount *SubgraphRequestCount // contains filtered or unexported fields }
func (*Environment) AbsintheSubscriptionURL ¶
func (e *Environment) AbsintheSubscriptionURL() string
func (*Environment) AbsintheWebsocketDialWithRetry ¶
func (*Environment) GraphQLRequestURL ¶
func (e *Environment) GraphQLRequestURL() string
func (*Environment) GraphQLServeSentEventsURL ¶
func (e *Environment) GraphQLServeSentEventsURL() string
func (*Environment) GraphQLSubscriptionURL ¶
func (e *Environment) GraphQLSubscriptionURL() string
func (*Environment) GraphQLWebsocketDialWithRetry ¶
func (*Environment) InitAbsintheWebSocketConnection ¶
func (e *Environment) InitAbsintheWebSocketConnection(header http.Header, initialPayload json.RawMessage) *websocket.Conn
func (*Environment) InitGraphQLWebSocketConnection ¶
func (e *Environment) InitGraphQLWebSocketConnection(header http.Header, initialPayload json.RawMessage) *websocket.Conn
func (*Environment) MakeGraphQLRequest ¶
func (e *Environment) MakeGraphQLRequest(request GraphQLRequest) (*TestResponse, error)
func (*Environment) MakeGraphQLRequestOK ¶
func (e *Environment) MakeGraphQLRequestOK(request GraphQLRequest) *TestResponse
func (*Environment) MakeRequest ¶
func (*Environment) SetExtraURLQueryValues ¶
func (e *Environment) SetExtraURLQueryValues(values url.Values)
func (*Environment) Shutdown ¶
func (e *Environment) Shutdown()
func (*Environment) WaitForConnectionCount ¶
func (e *Environment) WaitForConnectionCount(desiredCount uint64, timeout time.Duration)
func (*Environment) WaitForMessagesSent ¶
func (e *Environment) WaitForMessagesSent(desiredCount uint64, timeout time.Duration)
func (*Environment) WaitForServer ¶
func (*Environment) WaitForSubscriptionCount ¶
func (e *Environment) WaitForSubscriptionCount(desiredCount uint64, timeout time.Duration)
func (*Environment) WaitForTriggerCount ¶
func (e *Environment) WaitForTriggerCount(desiredCount uint64, timeout time.Duration)
type GraphQLError ¶
type GraphQLError struct {
Message string `json:"message"`
}
type GraphQLRequest ¶
type GraphQLRequest struct { Query string `json:"query"` Variables json.RawMessage `json:"variables,omitempty"` Extensions json.RawMessage `json:"extensions,omitempty"` OperationName json.RawMessage `json:"operationName,omitempty"` Header http.Header `json:"-"` }
type GraphQLResponse ¶
type GraphQLResponse struct { Data json.RawMessage `json:"data,omitempty"` Errors []GraphQLError `json:"errors,omitempty"` }
type NatsData ¶
type NatsData struct { Connections []*nats.Conn Server *natsserver.Server }
type SubgraphConfig ¶
type SubgraphRequestCount ¶
type SubgraphsConfig ¶
type SubgraphsConfig struct { GlobalMiddleware func(http.Handler) http.Handler GlobalDelay time.Duration Employees SubgraphConfig Family SubgraphConfig Hobbies SubgraphConfig Products SubgraphConfig Test1 SubgraphConfig Availability SubgraphConfig Mood SubgraphConfig Countries SubgraphConfig }
type WebSocketMessage ¶
type WebSocketMessage struct { ID string `json:"id,omitempty"` Type string `json:"type"` Payload json.RawMessage `json:"payload,omitempty"` }
Click to show internal directories.
Click to hide internal directories.