httpServer

package
v0.0.0-...-fa7900d Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteSession

func DeleteSession(ctx context.Context)

func GetHttpCookies

func GetHttpCookies(ctx context.Context) map[string]string

func NewLoggingResponseWriter

func NewLoggingResponseWriter(w http.ResponseWriter) *loggingResponseWriter

func NewReadSessionMiddleware

func NewReadSessionMiddleware(repo kv.Repo[*common.AuthSession], cookieName string, sessionKeyPrefix string) fiber.Handler

func NewRoundTripperWithHeaders

func NewRoundTripperWithHeaders(rt http.RoundTripper, headers map[string][]string) http.RoundTripper

func NewSessionMiddleware

func NewSessionMiddleware(
	repo kv.Repo[*common.AuthSession],
	cookieName string,
	cookieDomain string,
	sessionKeyPrefix string,
) fiber.Handler

Types

type HttpMiddleware

type HttpMiddleware func(handle http.HandlerFunc) http.HandlerFunc

func NewLoggingMiddleware

func NewLoggingMiddleware(logger logging.Logger) HttpMiddleware

func NewReadSessionMiddlewareHandler

func NewReadSessionMiddlewareHandler(repo kv.Repo[*common.AuthSession], cookieName string, sessionKeyPrefix string) HttpMiddleware

type Server

type Server interface {
	SetupGraphqlServer(es graphql.ExecutableSchema, middlewares ...fiber.Handler)
	Listen(addr string) error
	Close() error

	Raw() *fiber.App
}

func NewServer

func NewServer(args ServerArgs) Server

type ServerArgs

type ServerArgs struct {
	IsDev            bool
	Logger           logging.Logger
	CorsAllowOrigins *string
	IAMGrpcAddr      string `env:"IAM_GRPC_ADDR" required:"true"`
}

Jump to

Keyboard shortcuts

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