option

package
v1.1.1500 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

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 NatsUrl

func NatsUrl(url string) natsUrlOption

NatsUrl specifies the nats URL to connect to

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

func WithApiAuthorizer(authFn authz.APIFunc) apiAuthorizerOption

WithApiAuthorizer specifies a handler function for API authorization.

func WithAuthentication

func WithAuthentication(authFn authn.Check) authenticationOption

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

func WithSharVersion(version *version2.Version) sharVersionOption

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL