serveropts

package
v0.44.1 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 53 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, _ 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 WithCSRF added in v0.16.2

func WithCSRF() ServerOption

WithCSRF sets up the CSRF 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.Provider) ServerOption

WithConfigProvider supplies the config for the server

func WithCrypto added in v0.24.1

func WithCrypto() ServerOption

WithCrypto initializes the field level encryption system for the server

func WithDefaultTrustCenterDomain added in v0.20.5

func WithDefaultTrustCenterDomain() ServerOption

WithDefaultTrustCenterDomain sets up the default trust center domain 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 WithEntitlements added in v0.4.1

func WithEntitlements() ServerOption

WithEntitlements sets up the entitlements client for the server which currently only supports stripe

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 WithKeyDir added in v0.16.2

func WithKeyDir(dir string) ServerOption

WithKeyDir loads all PEM files in dir into the token key map. The filename (without extension) is used as the kid. This allows keys to be provided via mounted secrets

func WithKeyDirOption added in v0.16.2

func WithKeyDirOption() ServerOption

WithKeyDirOption allows the key directory to be set via server config.

func WithKeyDirWatcher added in v0.16.2

func WithKeyDirWatcher(dir string) ServerOption

WithKeyDirWatcher watches dir for changes to PEM files and reloads the TokenManager when keys are added or removed.

func WithMiddleware

func WithMiddleware() ServerOption

WithMiddleware adds the middleware to the server

func WithOTP

func WithOTP() ServerOption

WithOTP sets up the OTP provider

func WithObjectStorage added in v0.3.0

func WithObjectStorage() ServerOption

WithObjectStorage sets up the object storage for the server

func WithRateLimiter

func WithRateLimiter() ServerOption

WithRateLimiter sets up the rate limiter for the server

func WithReadyChecks

WithReadyChecks adds readiness checks to the server

func WithRedirects

func WithRedirects() ServerOption

WithRedirects sets up the redirects for the server

func WithSecretManagerKeys added in v0.16.2

func WithSecretManagerKeys(secretName string) ServerOption

WithSecretManagerKeys loads RSA keys from Google Secret Manager. The secret payload should contain either a PEM encoded private key or a JSON object mapping kid to PEM strings. The keys are written to temporary files and merged with any keys already defined.

func WithSecretManagerKeysOption added in v0.16.2

func WithSecretManagerKeysOption() ServerOption

WithSecretManagerKeysOption allows the secret manager secret name to be set via server config.

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 WithSummarizer added in v0.11.0

func WithSummarizer() ServerOption

WithSummarizer sets up the logic for summarizing long blurbs of texts

func WithTokenManager

func WithTokenManager() ServerOption

WithTokenManager sets up the token manager for the server

func WithWindmill added in v0.23.4

func WithWindmill() ServerOption

WithWindmill sets up the Windmill workflow automation client

type ServerOptions

type ServerOptions struct {
	// ConfigProvider is the provider for the server configuration
	ConfigProvider serverconfig.Provider
	// Config is the server configuration settings
	Config serverconfig.Config
}

ServerOptions defines the options for the server

func NewServerOptions

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

NewServerOptions creates a new ServerOptions instance with the provided options and configuration location

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