Documentation ¶
Overview ¶
Package serveropts contains an echo server options wrapper
Index ¶
- type ServerOption
- func WithAnalytics() ServerOption
- func WithAuth() ServerOption
- func WithCORS() ServerOption
- func WithCacheHeaders() ServerOption
- func WithConfigProvider(cfgProvider config.ConfigProvider) ServerOption
- func WithEmailManager() ServerOption
- func WithEventPublisher() ServerOption
- func WithGeneratedKeys() ServerOption
- func WithGraphRoute(srv *server.Server, c *generated.Client) ServerOption
- func WithHTTPS() ServerOption
- func WithLogger(l *zap.SugaredLogger) ServerOption
- func WithMiddleware() ServerOption
- func WithOTP() ServerOption
- func WithRateLimiter() ServerOption
- func WithReadyChecks(c *entx.EntClientConfig, f *fgax.Client, r *redis.Client) ServerOption
- func WithRedirects() ServerOption
- func WithSecureMW() ServerOption
- func WithSessionManager(rc *redis.Client) ServerOption
- func WithSessionMiddleware() ServerOption
- func WithTaskManager() ServerOption
- func WithTokenManager() ServerOption
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
func WithAnalytics ¶ added in v0.3.4
func WithAnalytics() ServerOption
WithAnalytics sets up the PostHog analytics manager
func WithAuth ¶
func WithAuth() ServerOption
WithAuth supplies the authn and jwt config for the server
func WithCORS ¶ added in v0.3.6
func WithCORS() ServerOption
WithCORS sets up the CORS middleware for the server
func WithCacheHeaders ¶ added in v0.3.6
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 WithEmailManager ¶ added in v0.2.2
func WithEmailManager() ServerOption
WithEmailManager sets up the default SendGrid email manager to be used to send emails to users on registration, password reset, etc
func WithEventPublisher ¶ added in v0.5.0
func WithEventPublisher() ServerOption
WithEventPublisher sets up the default Kafka event publisher
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 *generated.Client) ServerOption
WithGraphRoute adds the graph handler to the server
func WithLogger ¶
func WithLogger(l *zap.SugaredLogger) ServerOption
WithLogger supplies the logger for the server
func WithMiddleware ¶
func WithMiddleware() ServerOption
WithMiddleware adds the middleware to the server
func WithRateLimiter ¶ added in v0.3.6
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) ServerOption
WithReadyChecks adds readiness checks to the server
func WithRedirects ¶ added in v0.3.6
func WithRedirects() ServerOption
WithRedirects sets up the redirects for the server
func WithSecureMW ¶ added in v0.3.6
func WithSecureMW() ServerOption
WithSecureMW sets up the secure middleware for the server
func WithSessionManager ¶ added in v0.2.3
func WithSessionManager(rc *redis.Client) ServerOption
WithSessionManager sets up the default session manager with a 10 minute ttl with persistence to redis
func WithSessionMiddleware ¶ added in v0.6.8
func WithSessionMiddleware() ServerOption
WithSessionMiddleware sets up the session middleware for the server
func WithTaskManager ¶ added in v0.2.3
func WithTaskManager() ServerOption
WithTaskManager sets up the default Marionette task manager to be used for delegating background tasks
func WithTokenManager ¶ added in v0.6.8
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