Temporal Server options
Overview
You can run the Temporal server as a Go application by including the server package go.temporal.io/server/temporal
and using it to create and start a new server:
Options
NewServer()
accepts functions as parameters.
Each function returns a ServerOption
that is applied to the instance.
Source code for parameter reference is here: https://github.com/temporalio/temporal/blob/master/temporal/server_option.go
WithConfig
Overrides the default configuration with a custom configuration that is defined in the config package go.temporal.io/server/common/service/config
.
WithConfigLoader
Load a custom configuration from a file.
ForServices
Sets the list of all valid temporal services.
The default can be used from the go.temporal.io/server/temporal
package.
InterruptOn
This option provides a channel that interrupts the server on the signal from that channel.
- If
temporal.InterruptOn()
is not passed,server.Start()
is not blocking andserver.Stop()
needs to be called somewhere. - If
temporal.InterruptOn(nil)
is passed,server.Start()
blocks forever until the process is killed. - If
temporal.InterruptOn(temporal.InterruptCh())
is passed,server.Start()
blocks until Ctrl+C is used and then the server is gracefully shut down. - If
temporal.Interrupt(someCustomChan)
is passed,server.Start()
blocks until a signal is sent tosomeCustomChan
.
WithAuthorizer
Sets a low level authorization mechanism that determines whether to allow or deny inbound API calls.
WithTLSConfigFactory
Overrides the default TLS configuration provider.
TLSConfigProvider
is defined in the go.temporal.io/server/common/rpc/encryption
package.
WithClaimMapper
Configures a mechanism to map roles to Claims
for authorization.
WithCustomMetricsReporter
Sets a custom tally metric reporter.