api

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: MIT Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticationMiddleware

func AuthenticationMiddleware(next http.Handler) http.Handler

AuthenticationMiddleware is a middleware that extracts the JWT Token from the Authorization header and stores it in the context for the directiveAuthorization.

func AuthzByPolicyMiddleware

func AuthzByPolicyMiddleware(next http.Handler) http.Handler

AuthzByPolicyMiddleware is a middleware that checks the request IP and stores it in the context for the directiveAuthzByPolicy. It is used by the directiveAuthzByPolicy.

func CurrentUserFromContext

func CurrentUserFromContext(ctx context.Context) (*modelgen.User, error)

CurrentUserFromContext will retrieve the current user from the context.

func LoggingMiddleware

func LoggingMiddleware(next http.Handler) http.Handler

LoggingMiddleware logs the incoming HTTP request & its duration.

func NewSchema

func NewSchema(client *modelgen.Client, tr trace.Tracer) graphql.ExecutableSchema

NewSchema creates a graphql executable schema.

Types

type Resolver

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

func (*Resolver) Mutation

func (r *Resolver) Mutation() apigen.MutationResolver

Mutation returns apigen.MutationResolver implementation.

func (*Resolver) Query

func (r *Resolver) Query() apigen.QueryResolver

Query returns apigen.QueryResolver implementation.

func (*Resolver) User

func (r *Resolver) User() apigen.UserResolver

User returns apigen.UserResolver implementation.

Jump to

Keyboard shortcuts

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