httpServer

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2024 License: AGPL-3.0 Imports: 21 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 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