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 WithNoSplash() showNoSplashOption
- func WithSharVersion(version *version2.Version) sharVersionOption
- type BackingStore
- 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 WithNoSplash ¶ added in v1.1.1687
func WithNoSplash() showNoSplashOption
WithNoSplash specifies not to show a splash screen on the SHAR server startup. Enabling this option will hide the splash screen.
func WithSharVersion ¶
WithSharVersion instructs SHAR to claim it is a specific version. This is highly inadvisable as datalos may occur.
Types ¶
type BackingStore ¶ added in v1.1.1687
type BackingStore int
BackingStore represents a storage type.
const ( // NatsKV - Use nats key value store. NatsKV BackingStore = iota // Postgres - Use postgres table store. Postgres )
func StoreType ¶ added in v1.1.1687
func StoreType(t string) BackingStore
StoreType converts a string to a backing store type.
type Option ¶
type Option interface {
Configure(serverOptions *ServerOptions)
}
Option represents a SHAR server option
func WithHistoryStore ¶ added in v1.1.1687
func WithHistoryStore(kv BackingStore, connectionString string) Option
WithHistoryStore specifies an alternative history store
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
ShowSplash bool
JetStreamDomain string
NatsConnOptions []nats.Option
HistoryStore BackingStore
HistoryStoreConnection string
}
ServerOptions contains settings that control various aspects of shar operation and behaviour