apihandler

package
v0.90.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WG_PREFIX    = "wg_"
	WG_LIVE      = WG_PREFIX + "live"
	WG_VARIABLES = WG_PREFIX + "variables"
)

Variables

This section is empty.

Functions

func CreateHooksJWT

func CreateHooksJWT(secret []byte) (string, error)

func GenSymmetricKey

func GenSymmetricKey(bits int) (k []byte, err error)

func HttpRequestToWunderGraphRequestJSON

func HttpRequestToWunderGraphRequestJSON(r *http.Request, withBody bool) ([]byte, error)

func MergeJsonRightIntoLeft

func MergeJsonRightIntoLeft(left, right []byte) []byte

MergeJsonRightIntoLeft merges the right JSON into the left JSON while overriding the left side

func NewApiTransport

func NewApiTransport(tripper http.RoundTripper, api *wgpb.Api, hooksClient *middlewareclient.MiddlewareClient, enableDebugMode bool) http.RoundTripper

Types

type ApiTransport

type ApiTransport struct {
	// contains filtered or unexported fields
}

func (*ApiTransport) RoundTrip

func (t *ApiTransport) RoundTrip(request *http.Request) (*http.Response, error)

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

func (*Builder) BuildAndMountApiHandler

func (r *Builder) BuildAndMountApiHandler(ctx context.Context, router *mux.Router, api *wgpb.Api) (streamClosers []chan struct{}, err error)

type BuilderConfig

type BuilderConfig struct {
	InsecureCookies            bool
	ForceHttpsRedirects        bool
	EnableDebugMode            bool
	EnableIntrospection        bool
	GitHubAuthDemoClientID     string
	GitHubAuthDemoClientSecret string
}

type Claims

type Claims struct {
	Name string `json:"name"`
	jwt.StandardClaims
}

type EndpointUnavailableHandler

type EndpointUnavailableHandler struct {
	OperationName string
}

func (*EndpointUnavailableHandler) ServeHTTP

type GraphQLHandler

type GraphQLHandler struct {
	// contains filtered or unexported fields
}

func (*GraphQLHandler) ServeHTTP

func (h *GraphQLHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GraphQLPlaygroundHandler

type GraphQLPlaygroundHandler struct {
	// contains filtered or unexported fields
}

func (*GraphQLPlaygroundHandler) ServeHTTP

type InternalApiHandler

type InternalApiHandler struct {
	// contains filtered or unexported fields
}

func (*InternalApiHandler) ServeHTTP

func (h *InternalApiHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type InternalBuilder

type InternalBuilder struct {
	// contains filtered or unexported fields
}

func (*InternalBuilder) BuildAndMountInternalApiHandler

func (i *InternalBuilder) BuildAndMountInternalApiHandler(ctx context.Context, router *mux.Router, api *wgpb.Api, secret []byte) (streamClosers []chan struct{}, err error)

type MutationHandler

type MutationHandler struct {
	// contains filtered or unexported fields
}

func (*MutationHandler) ServeHTTP

func (h *MutationHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

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 OpenIDConnectConfiguration

type OpenIDConnectConfiguration struct {
	Issuer                string `json:"issuer"`
	AuthorizationEndpoint string `json:"authorization_endpoint"`
	TokenEndpoint         string `json:"token_endpoint"`
	UserinfoEndpoint      string `json:"userinfo_endpoint"`
	JwksUri               string `json:"jwks_uri"`
	EndSessionEndpoint    string `json:"end_session_endpoint"`
}

type OperationMetaData

type OperationMetaData struct {
	OperationName string
	OperationType wgpb.OperationType
}

func (*OperationMetaData) GetOperationTypeString

func (o *OperationMetaData) GetOperationTypeString() string

type QueryHandler

type QueryHandler struct {
	// contains filtered or unexported fields
}

func (*QueryHandler) ServeHTTP

func (h *QueryHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type QueryResolver

type QueryResolver interface {
	ResolveGraphQLResponse(ctx *resolve.Context, response *resolve.GraphQLResponse, data []byte, writer io.Writer) (err error)
}

type SubscriptionHandler

type SubscriptionHandler struct {
	// contains filtered or unexported fields
}

func (*SubscriptionHandler) ServeHTTP

func (h *SubscriptionHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type WunderGraphRequest

type WunderGraphRequest struct {
	Method     string            `json:"method"`
	RequestURI string            `json:"requestURI"`
	Headers    map[string]string `json:"headers"`
	Body       json.RawMessage   `json:"body,omitempty"`
}

type WunderGraphResponse

type WunderGraphResponse struct {
	StatusCode int               `json:"statusCode"`
	Status     string            `json:"status"`
	Method     string            `json:"method"`
	RequestURI string            `json:"requestURI"`
	Headers    map[string]string `json:"headers"`
	Body       json.RawMessage   `json:"body,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL