apihandler

package
v0.106.3 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 56 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 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 *hooks.Client, enableDebugMode bool) http.RoundTripper

func NewApiTransportFactory added in v0.93.2

func NewApiTransportFactory(api *wgpb.Api, hooksClient *hooks.Client, enableDebugMode bool) func(tripper http.RoundTripper) http.RoundTripper

func NewRequestFromWunderGraphClientRequest added in v0.92.0

func NewRequestFromWunderGraphClientRequest(ctx context.Context, body []byte) (*http.Request, error)

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 NewBuilder

func NewBuilder(pool *pool.Pool,
	log abstractlogger.Logger,
	loader *engineconfigloader.EngineConfigLoader,
	hooksClient *hooks.Client,
	config BuilderConfig,
) *Builder

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
	HookServerURL              string
	DevMode                    bool
}

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 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)

Jump to

Keyboard shortcuts

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