web

package
v0.0.0-...-ec25b82 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const RequestIDHeaderName = "X-Request-ID"

Variables

This section is empty.

Functions

func AccessLogMiddleware

func AccessLogMiddleware(excludeRemoteAddr bool, excludedHeaderPatterns []string, next http.HandlerFunc) http.HandlerFunc

func CORSMiddleware

func CORSMiddleware(
	allowedOrigins []string,
	allowedMethods []string,
	allowedHeaders []string,
	disableCredentials bool,
	exposeHeaders []string,
	maxAge time.Duration,
	next http.HandlerFunc) http.HandlerFunc

func DescopeAuthenticationMiddleware

func DescopeAuthenticationMiddleware(descopeClient *client.DescopeClient, next http.HandlerFunc) http.HandlerFunc

func GetDescopeClient

func GetDescopeClient(ctx context.Context) *client.DescopeClient

func GetToken

func GetToken(ctx context.Context) *descope.Token

func Neo4jClientMiddleware

func Neo4jClientMiddleware(neo4jDriver neo4j.DriverWithContext, next http.HandlerFunc) http.HandlerFunc

func NewServer

func NewServer(
	port int,
	accessLog bool,
	accessLogExcludedHeaders []string,
	accessLogExcludeRemoteAddr bool,
	allowedOrigins []string,
	allowedMethods []string,
	allowedHeaders []string,
	disableCredentials bool,
	exposeHeaders []string,
	maxAge time.Duration,
	redisClient rueidis.Client,
	neo4jDriver neo4j.DriverWithContext,
	descopeClient *descope.DescopeClient,
	graphHandler http.HandlerFunc,
) *http.Server

func RedisClientMiddleware

func RedisClientMiddleware(redisClient rueidis.Client, next http.HandlerFunc) http.HandlerFunc

func RequestIDMiddleware

func RequestIDMiddleware(next http.HandlerFunc) http.HandlerFunc

Types

type HealthCheck

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

func NewHealthCheck

func NewHealthCheck(port int) *HealthCheck

func (*HealthCheck) Start

func (hc *HealthCheck) Start(ctx context.Context)

func (*HealthCheck) Stop

func (hc *HealthCheck) Stop(ctx context.Context)

Jump to

Keyboard shortcuts

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