serveropts

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package serveropts contains an echo server options wrapper

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LevelNameHook added in v0.1.10

type LevelNameHook struct{}

LevelNameHook is a hook that sets the level name field to "info" if the level is not set.

func (LevelNameHook) Run added in v0.1.10

func (h LevelNameHook) Run(e *zerolog.Event, l zerolog.Level, msg string)

Run satisfies the zerolog.Hook interface.

type ServerOption

type ServerOption interface {
	// contains filtered or unexported methods
}

func WithAuth

func WithAuth() ServerOption

WithAuth supplies the authn and jwt config for the server

func WithCORS

func WithCORS() ServerOption

WithCORS sets up the CORS middleware for the server

func WithCacheHeaders

func WithCacheHeaders() ServerOption

WithCacheHeaders sets up the cache control headers for the server

func WithConfigProvider

func WithConfigProvider(cfgProvider config.ConfigProvider) ServerOption

WithConfigProvider supplies the config for the server

func WithEmailConfig added in v0.2.0

func WithEmailConfig() ServerOption

WithEmailConfig sets up the email config to be used to send emails to users on registration, password reset, etc

func WithGeneratedKeys

func WithGeneratedKeys() ServerOption

WithGeneratedKeys will generate a public/private key pair that can be used for jwt signing. This should only be used in a development environment

func WithGraphRoute

func WithGraphRoute(srv *server.Server, c *ent.Client) ServerOption

WithGraphRoute adds the graph handler to the server

func WithHTTPS

func WithHTTPS() ServerOption

WithHTTPS sets up TLS config settings for the server

func WithMiddleware

func WithMiddleware() ServerOption

WithMiddleware adds the middleware to the server

func WithOTP

func WithOTP() ServerOption

WithOTP sets up the OTP provider

func WithRateLimiter

func WithRateLimiter() ServerOption

WithRateLimiter sets up the rate limiter for the server

func WithReadyChecks

func WithReadyChecks(c *entx.EntClientConfig, f *fgax.Client, r *redis.Client, j riverqueue.JobClient) ServerOption

WithReadyChecks adds readiness checks to the server

func WithRedirects

func WithRedirects() ServerOption

WithRedirects sets up the redirects for the server

func WithSecureMW

func WithSecureMW() ServerOption

WithSecureMW sets up the secure middleware for the server

func WithSessionManager

func WithSessionManager(rc *redis.Client) ServerOption

WithSessionManager sets up the default session manager with a 10 minute ttl with persistence to redis

func WithSessionMiddleware

func WithSessionMiddleware() ServerOption

WithSessionMiddleware sets up the session middleware for the server

func WithTokenManager

func WithTokenManager() ServerOption

WithTokenManager sets up the token manager for the server

type ServerOptions

type ServerOptions struct {
	ConfigProvider serverconfig.ConfigProvider
	Config         serverconfig.Config
}

func NewServerOptions

func NewServerOptions(opts []ServerOption, cfgLoc string) *ServerOptions

func (*ServerOptions) AddServerOptions

func (so *ServerOptions) AddServerOptions(opt ServerOption)

AddServerOptions applies a server option after the initial setup this should be used when information is not available on NewServerOptions

Jump to

Keyboard shortcuts

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