Documentation
¶
Overview ¶
Package serveropts contains an echo server options wrapper
Index ¶
- type ServerOption
- func WithAuth(settings map[string]any) ServerOption
- func WithConfigProvider(cfgProvider config.ConfigProvider) ServerOption
- func WithFGAAuthz(settings map[string]any) ServerOption
- func WithGeneratedKeys(settings map[string]any) ServerOption
- func WithGraphRoute(srv *server.Server, c *generated.Client, settings map[string]any, ...) ServerOption
- func WithHTTPS(settings map[string]any) ServerOption
- func WithLogger(l *zap.SugaredLogger) ServerOption
- func WithMiddleware(mw []echo.MiddlewareFunc) ServerOption
- func WithReadyChecks(c *entdb.EntClientConfig, f *fga.Client) ServerOption
- func WithSQLiteDB(settings map[string]any) ServerOption
- func WithServer(settings map[string]any) 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 WithAuth ¶
func WithAuth(settings map[string]any) ServerOption
WithAuth supplies the authn and jwt config for the server
func WithConfigProvider ¶
func WithConfigProvider(cfgProvider config.ConfigProvider) ServerOption
WithConfigProvider supplies the config for the server
func WithFGAAuthz ¶
func WithFGAAuthz(settings map[string]any) ServerOption
WithFGAAuthz supplies the FGA authz config for the server
func WithGeneratedKeys ¶
func WithGeneratedKeys(settings map[string]any) 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, settings map[string]any, mw []echo.MiddlewareFunc) ServerOption
WithGraphRoute adds the graph handler to the server
func WithHTTPS ¶
func WithHTTPS(settings map[string]any) ServerOption
WithHTTPS sets up TLS config settings for the server
func WithLogger ¶
func WithLogger(l *zap.SugaredLogger) ServerOption
WithLogger supplies the logger for the server
func WithMiddleware ¶
func WithMiddleware(mw []echo.MiddlewareFunc) ServerOption
WithMiddleware adds the middleware to the server
func WithReadyChecks ¶
func WithReadyChecks(c *entdb.EntClientConfig, f *fga.Client) ServerOption
WithReadyChecks adds readiness checks to the server
func WithSQLiteDB ¶
func WithSQLiteDB(settings map[string]any) ServerOption
WithSQLiteDB supplies the sqlite db config for the server
func WithServer ¶
func WithServer(settings map[string]any) ServerOption
WithServer supplies the echo server config for the server
type ServerOptions ¶
type ServerOptions struct { ConfigProvider config.ConfigProvider Config config.Config }
func NewServerOptions ¶
func NewServerOptions(opts []ServerOption) *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