{"modulePath":"github.com/theopenlane/core","version":"v1.34.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package serveropts\n\nPackage serveropts contains an echo server options wrapper\n\n## Variables\n\n```go\nvar ErrNoSigningKeys = errors.New(\"no signing keys found in key directory\")\n```\nErrNoSigningKeys is returned when no signing keys are found in the key directory\n\n## Functions\n\n```go\nfunc ConfigureGala(ctx context.Context, galaApp, notificationGala *gala.Gala, dbClient *ent.Client, so *ServerOptions) error\n```\nConfigureGala wires the gala runtimes to the database client, registers all listeners, and starts workers. It must be called after the database client is created.\n\n```go\nfunc NewGalaRuntimes(ctx context.Context, so *ServerOptions) (*gala.Gala, *gala.Gala, error)\n```\nNewGalaRuntimes creates the main and notification gala runtimes from configuration. It does not wire the runtimes to the database client; call ConfigureGala for that.\n\n## Types\n\n```go\ntype ServerOption interface {\n\t// contains filtered or unexported methods\n}\n```\n\n```go\nfunc WithAuth() ServerOption\n```\nWithAuth supplies the authn and jwt config for the server\n\n```go\nfunc WithBackfill(ctx context.Context, dbClient *ent.Client) ServerOption\n```\nWithBackfill runs a one-time, non-blocking, config-gated, idempotent startup backfills use-cases for this are things a db migration can't easily handle, computed data or fields, or repairs\n\n```go\nfunc WithCORS() ServerOption\n```\nWithCORS sets up the CORS middleware for the server\n\n```go\nfunc WithCSRF() ServerOption\n```\nWithCSRF sets up the CSRF middleware for the server\n\n```go\nfunc WithCacheHeaders() ServerOption\n```\nWithCacheHeaders sets up the cache control headers for the server\n\n```go\nfunc WithCloudflareConfig() ServerOption\n```\nWithCloudflareConfig sets up the Cloudflare configuration for the server\n\n```go\nfunc WithConfigProvider(cfgProvider config.Provider) ServerOption\n```\nWithConfigProvider supplies the config for the server\n\n```go\nfunc WithDefaultTrustCenterDomain() ServerOption\n```\nWithDefaultTrustCenterDomain sets up the default trust center domain for the server\n\n```go\nfunc WithEntitlements() ServerOption\n```\nWithEntitlements sets up the entitlements client for the server which currently only supports stripe\n\n```go\nfunc WithGeneratedKeys() ServerOption\n```\nWithGeneratedKeys will generate a public/private key pair that can be used for jwt signing. This should only be used in a development environment\n\n```go\nfunc WithGraphRateLimiter() ServerOption\n```\nWithGraphRateLimiter prepends a dedicated rate limiter to the GraphQL middleware chain so the primary API surface is throttled ahead of authentication and resolver work\n\n```go\nfunc WithGraphRoute(srv *server.Server, c *ent.Client) ServerOption\n```\nWithGraphRoute adds the graph handler to the server\n\n```go\nfunc WithHTTPS() ServerOption\n```\nWithHTTPS sets up TLS config settings for the server\n\n```go\nfunc WithHistoryGraphRoute(srv *server.Server, c *historygenerated.Client) ServerOption\n```\nWithGraphRoute adds the graph handler to the server\n\n```go\nfunc WithIntegrationsRuntime(ctx context.Context, dbClient *ent.Client) ServerOption\n```\nWithIntegrationsRuntime builds the integration runtime from server settings and wires it into the handler. When a workflow engine is present it also injects integration dependencies. Initialization is skipped if the database client or Gala runtime is nil.\n\n```go\nfunc WithKeyDirConfig() ServerOption\n```\nWithKeyDirConfig loads the keys in the configured key directory into the token config so the token manager can be built from them. It must run before WithTokenManager\n\n```go\nfunc WithKeyDirKeyWatcher(rc *redis.Client) ServerOption\n```\nWithKeyDirKeyWatcher starts the key directory watcher against the running token manager. It must run after WithTokenManager, and after the redis client exists for the archive to outlive a single pod\n\n```go\nfunc WithKeyDirWatcher(dir string, base tokens.Config, archive keyArchive) ServerOption\n```\nWithKeyDirWatcher watches dir and applies key changes to the existing TokenManager. The manager is mutated rather than replaced so consumers holding the pointer, notably the ent client, keep signing and verifying with current keys\n\n```go\nfunc WithMiddleware() ServerOption\n```\nWithMiddleware adds the middleware to the server\n\n```go\nfunc WithOTP() ServerOption\n```\nWithOTP sets up the OTP provider\n\n```go\nfunc WithObjectStorage() ServerOption\n```\nWithObjectStorage sets up the object storage for the server\n\n```go\nfunc WithRateLimiter() ServerOption\n```\nWithRateLimiter sets up the global and unmatched-route rate limiters for the server\n\n```go\nfunc WithReadyChecks(c *entx.EntClientConfig, f *fgax.Client, r *redis.Client, j riverqueue.JobClient) ServerOption\n```\nWithReadyChecks adds readiness checks to the server\n\n```go\nfunc WithSecureMW() ServerOption\n```\nWithSecureMW sets up the secure middleware for the server\n\n```go\nfunc WithSessionManager(rc *redis.Client) ServerOption\n```\nWithSessionManager sets up the default session manager with a 10 minute ttl with persistence to redis\n\n```go\nfunc WithSessionMiddleware() ServerOption\n```\nWithSessionMiddleware sets up the session middleware for the server\n\n```go\nfunc WithShortlinks() ServerOption\n```\nWithShortlinks sets up the shortlinks client for URL shortening\n\n```go\nfunc WithSummarizer() ServerOption\n```\nWithSummarizer sets up the logic for summarizing long blurbs of texts\n\n```go\nfunc WithSupportAccessConfig() ServerOption\n```\nWithSupportAccessConfig sets up the Openlane support access configuration for the server\n\n```go\nfunc WithTokenManager() ServerOption\n```\nWithTokenManager sets up the token manager for the server\n\n```go\nfunc WithWorkflows(wf *engine.WorkflowEngine) ServerOption\n```\nWithWorkflows sets up the workflows engine for the server\n\n```go\ntype ServerOptions struct {\n\t// ConfigProvider is the provider for the server configuration\n\tConfigProvider serverconfig.Provider\n\t// Config is the server configuration settings\n\tConfig serverconfig.Config\n\t// contains filtered or unexported fields\n}\n```\nServerOptions defines the options for the server\n\n```go\nfunc NewServerOptions(opts []ServerOption, cfgLoc string) *ServerOptions\n```\nNewServerOptions creates a new ServerOptions instance with the provided options and configuration location\n\n```go\nfunc (so *ServerOptions) AddServerOptions(opts ...ServerOption)\n```\nAddServerOptions applies server options after the initial setup this should be used when information is not available on NewServerOptions\n\n","path":"github.com/theopenlane/core/internal/httpserve/serveropts","name":"serveropts","synopsis":"Package serveropts contains an echo server options wrapper","isRedistributable":true}
