Documentation ¶
Index ¶
- func Concurrency(n int) concurrencyOption
- func GrpcPort(port int) grpcPortOption
- func NatsUrl(url string) natsUrlOption
- func PanicRecovery(enabled bool) panicOption
- func PreventOrphanServiceTasks() orphanTaskOption
- func WithApiAuthorizer(authFn authz.APIFunc) apiAuthorizerOption
- func WithAuthentication(authFn authn.Check) authenticationOption
- func WithJetStreamDomain(jsDomain string) jetStreamDomainOption
- func WithNoHealthServer() noHealthServerOption
- func WithSharVersion(version *version2.Version) sharVersionOption
- func WithShowSplash() showSplashOption
- func WithTelemetryEndpoint(endpoint string) telemetryEndpointOption
- type Option
- type ServerOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Concurrency ¶
func Concurrency(n int) concurrencyOption
Concurrency specifies the number of threads for each of SHAR's queue listeneres.
func GrpcPort ¶
func GrpcPort(port int) grpcPortOption
GrpcPort specifies the port healthcheck is listening on
func PanicRecovery ¶
func PanicRecovery(enabled bool) panicOption
PanicRecovery enables or disables SHAR's ability to recover from server panics. This is on by default, and disabling it is not recommended for production use.
func PreventOrphanServiceTasks ¶
func PreventOrphanServiceTasks() orphanTaskOption
PreventOrphanServiceTasks enables or disables SHAR's validation of service task names againt existing workflows.
func WithApiAuthorizer ¶
WithApiAuthorizer specifies a handler function for API authorization.
func WithAuthentication ¶
WithAuthentication specifies a handler function for API authorization.
func WithJetStreamDomain ¶ added in v1.1.1327
func WithJetStreamDomain(jsDomain string) jetStreamDomainOption
WithJetStreamDomain specifies a handler function for API authorization.
func WithNoHealthServer ¶
func WithNoHealthServer() noHealthServerOption
WithNoHealthServer specifies a handler function for API authorization.
func WithSharVersion ¶
WithSharVersion instructs SHAR to claim it is a specific version. This is highly inadvisable as datalos may occur.
func WithShowSplash ¶
func WithShowSplash() showSplashOption
WithShowSplash specifies whether to show a splash screen on the SHAR server startup. Enabling this option will make the splash screen be displayed.
func WithTelemetryEndpoint ¶
func WithTelemetryEndpoint(endpoint string) telemetryEndpointOption
WithTelemetryEndpoint specifies a handler function for API authorization.
Types ¶
type Option ¶
type Option interface {
Configure(serverOptions *ServerOptions)
}
Option represents a SHAR server option
type ServerOptions ¶
type ServerOptions struct { PanicRecovery bool AllowOrphanServiceTasks bool Concurrency int ApiAuthorizer authz.APIFunc ApiAuthenticator authn.Check HealthServiceEnabled bool SharVersion *version2.Version NatsUrl string GrpcPort int TelemetryConfig telemetry.Config ShowSplash bool JetStreamDomain string NatsConnOptions []nats.Option }
ServerOptions contains settings that control various aspects of shar operation and behaviour