Documentation ¶
Index ¶
- func HeaderCSVToSlice(headers map[string]string) map[string][]string
- func HeaderSliceToCSV(headers map[string][]string) map[string]string
- func HttpRequestToWunderGraphRequestJSON(r *http.Request, withBody bool) ([]byte, error)
- type Client
- func (c *Client) DoAuthenticationRequest(ctx context.Context, hook MiddlewareHook, jsonData []byte) (*MiddlewareHookResponse, error)
- func (c *Client) DoFunctionRequest(ctx context.Context, operationName string, jsonData []byte) (*MiddlewareHookResponse, error)
- func (c *Client) DoFunctionSubscriptionRequest(ctx context.Context, operationName string, jsonData []byte, ...) error
- func (c *Client) DoGlobalRequest(ctx context.Context, hook MiddlewareHook, jsonData []byte) (*MiddlewareHookResponse, error)
- func (c *Client) DoHealthCheckRequest(ctx context.Context) (status bool)
- func (c *Client) DoOperationRequest(ctx context.Context, operationName string, hook MiddlewareHook, ...) (*MiddlewareHookResponse, error)
- func (c *Client) DoUploadRequest(ctx context.Context, providerName string, profileName string, hook UploadHook, ...) (*UploadHookResponse, error)
- func (c *Client) DoWsTransportRequest(ctx context.Context, hook MiddlewareHook, jsonData []byte) (*MiddlewareHookResponse, error)
- type HookResponse
- type MiddlewareHook
- type MiddlewareHookResponse
- type OnRequestHookPayload
- type OnRequestHookResponse
- type OnResponseHookPayload
- type OnResponseHookResponse
- type OnWsConnectionInitHookPayload
- type UploadHook
- type UploadHookResponse
- type WunderGraphRequest
- type WunderGraphResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DoAuthenticationRequest ¶
func (c *Client) DoAuthenticationRequest(ctx context.Context, hook MiddlewareHook, jsonData []byte) (*MiddlewareHookResponse, error)
func (*Client) DoFunctionRequest ¶ added in v0.126.0
func (*Client) DoFunctionSubscriptionRequest ¶ added in v0.126.0
func (*Client) DoGlobalRequest ¶
func (c *Client) DoGlobalRequest(ctx context.Context, hook MiddlewareHook, jsonData []byte) (*MiddlewareHookResponse, error)
func (*Client) DoHealthCheckRequest ¶ added in v0.114.0
func (*Client) DoOperationRequest ¶
func (c *Client) DoOperationRequest(ctx context.Context, operationName string, hook MiddlewareHook, jsonData []byte) (*MiddlewareHookResponse, error)
func (*Client) DoUploadRequest ¶ added in v0.127.0
func (c *Client) DoUploadRequest(ctx context.Context, providerName string, profileName string, hook UploadHook, jsonData []byte) (*UploadHookResponse, error)
func (*Client) DoWsTransportRequest ¶ added in v0.112.0
func (c *Client) DoWsTransportRequest(ctx context.Context, hook MiddlewareHook, jsonData []byte) (*MiddlewareHookResponse, error)
type HookResponse ¶ added in v0.127.0
type HookResponse interface {
ResponseError() string
}
type MiddlewareHook ¶
type MiddlewareHook string
const ( MockResolve MiddlewareHook = "mockResolve" PreResolve MiddlewareHook = "preResolve" PostResolve MiddlewareHook = "postResolve" CustomResolve MiddlewareHook = "customResolve" MutatingPreResolve MiddlewareHook = "mutatingPreResolve" MutatingPostResolve MiddlewareHook = "mutatingPostResolve" PostAuthentication MiddlewareHook = "postAuthentication" PostLogout MiddlewareHook = "postLogout" MutatingPostAuthentication MiddlewareHook = "mutatingPostAuthentication" RevalidateAuthentication MiddlewareHook = "revalidateAuthentication" // HttpTransportOnRequest to the origin HttpTransportOnRequest MiddlewareHook = "onOriginRequest" // HttpTransportOnResponse from the origin HttpTransportOnResponse MiddlewareHook = "onOriginResponse" WsTransportOnConnectionInit MiddlewareHook = "onConnectionInit" )
type MiddlewareHookResponse ¶
type MiddlewareHookResponse struct { Error string `json:"error,omitempty"` Op string `json:"op"` Hook string `json:"hook"` Response json.RawMessage `json:"response"` Input json.RawMessage `json:"input"` SetClientRequestHeaders map[string]string `json:"setClientRequestHeaders"` // ClientResponseStatusCode is the status code that should be returned to the client ClientResponseStatusCode int }
func (*MiddlewareHookResponse) ResponseError ¶ added in v0.127.0
func (r *MiddlewareHookResponse) ResponseError() string
type OnRequestHookPayload ¶
type OnRequestHookPayload struct { Request WunderGraphRequest `json:"request"` OperationName string `json:"operationName"` OperationType string `json:"operationType"` }
type OnRequestHookResponse ¶
type OnRequestHookResponse struct { Skip bool `json:"skip"` Cancel bool `json:"cancel"` Request *WunderGraphRequest `json:"request"` }
type OnResponseHookPayload ¶
type OnResponseHookPayload struct { Response WunderGraphResponse `json:"response"` OperationName string `json:"operationName"` OperationType string `json:"operationType"` }
type OnResponseHookResponse ¶
type OnResponseHookResponse struct { Skip bool `json:"skip"` Cancel bool `json:"cancel"` Response *WunderGraphResponse `json:"response"` }
type OnWsConnectionInitHookPayload ¶ added in v0.112.0
type OnWsConnectionInitHookPayload struct { DataSourceID string `json:"dataSourceId"` Request WunderGraphRequest `json:"request"` }
type UploadHook ¶ added in v0.127.0
type UploadHook string
const ( PreUpload UploadHook = "preUpload" PostUpload UploadHook = "postUpload" )
type UploadHookResponse ¶ added in v0.127.0
func (*UploadHookResponse) ResponseError ¶ added in v0.127.0
func (r *UploadHookResponse) ResponseError() string
type WunderGraphRequest ¶
type WunderGraphResponse ¶
Click to show internal directories.
Click to hide internal directories.