httpServer

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: AGPL-3.0 Imports: 21 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 GetHttpSession

func GetHttpSession[T repos.Entity](ctx context.Context) T

func GetSession

func GetSession[T repos.Entity](ctx context.Context) T

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

func SetSession

func SetSession[T repos.Entity](ctx context.Context, session T)

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 is deprecated, now use Slogger
	Logger           logging.Logger
	Slogger          *slog.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