option

package
v1.1.1139 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 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 EphemeralStorage

func EphemeralStorage() ephemeralStorageOption

EphemeralStorage instructs SHAR to use memory rather than disk for storage. This is not recommended for production use.

func GrpcPort

func GrpcPort(port int) grpcPortOption

GrpcPort specifies the port healthcheck is listening on

func NatsConn

func NatsConn(conn *nats.Conn) natsConnOption

NatsConn specifies the nats Conn to use

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 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 {
	EphemeralStorage        bool
	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
	// contains filtered or unexported fields
}

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