Documentation ¶
Index ¶
- type Server
- type ServerOption
- func WithBaseConfig(base *config.Config) ServerOption
- func WithDatabaseFilePath(filepath string) ServerOption
- func WithDynamicConfigValue(key dynamicconfig.Key, value []dynamicconfig.ConstrainedValue) ServerOption
- func WithDynamicPorts() ServerOption
- func WithFrontendIP(address string) ServerOption
- func WithFrontendPort(port int) ServerOption
- func WithLogger(logger log.Logger) ServerOption
- func WithMetricsPort(port int) ServerOption
- func WithNamespaces(namespaces ...string) ServerOption
- func WithPersistenceDisabled() ServerOption
- func WithSQLitePragmas(pragmas map[string]string) ServerOption
- func WithSearchAttributeCacheDisabled() ServerOption
- func WithUI(server liteconfig.UIServer) ServerOption
- func WithUpstreamOptions(options ...temporal.ServerOption) ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server wraps temporal.Server.
func NewServer ¶
func NewServer(opts ...ServerOption) (*Server, error)
NewServer returns a new instance of Server.
func (*Server) FrontendHostPort ¶
FrontendHostPort returns the host:port for this server.
When constructing a Temporalite client from within the same process, NewClient or NewClientWithOptions should be used instead.
func (*Server) NewClient ¶
NewClient initializes a client ready to communicate with the Temporal server in the target namespace.
func (*Server) NewClientWithOptions ¶
func (s *Server) NewClientWithOptions(ctx context.Context, options client.Options) (client.Client, error)
NewClientWithOptions is the same as NewClient but allows further customization.
To set the client's namespace, use the corresponding field in client.Options.
Note that the HostPort and ConnectionOptions fields of client.Options will always be overridden.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
func WithBaseConfig ¶
func WithBaseConfig(base *config.Config) ServerOption
WithBaseConfig sets the default Temporal server configuration.
Storage and client configuration will always be overridden, however base config can be used to enable settings like TLS or authentication.
func WithDatabaseFilePath ¶
func WithDatabaseFilePath(filepath string) ServerOption
WithDatabaseFilePath persists state to the file at the specified path.
func WithDynamicConfigValue ¶
func WithDynamicConfigValue(key dynamicconfig.Key, value []dynamicconfig.ConstrainedValue) ServerOption
WithDynamicConfigValue sets the given dynamic config key with the given set of values. This will overwrite the key if already set.
func WithDynamicPorts ¶
func WithDynamicPorts() ServerOption
WithDynamicPorts starts Temporal on system-chosen ports.
func WithFrontendIP ¶
func WithFrontendIP(address string) ServerOption
WithFrontendIP binds the temporal-frontend GRPC service to a specific IP (eg. `0.0.0.0`) Check net.ParseIP for supported syntax; only IPv4 is supported.
When unspecified, the frontend service will bind to localhost.
func WithFrontendPort ¶
func WithFrontendPort(port int) ServerOption
WithFrontendPort sets the listening port for the temporal-frontend GRPC service.
When unspecified, the default port number of 7233 is used.
func WithLogger ¶
func WithLogger(logger log.Logger) ServerOption
WithLogger overrides the default logger.
func WithMetricsPort ¶
func WithMetricsPort(port int) ServerOption
WithMetricsPort sets the listening port for metrics.
When unspecified, the port will be system-chosen.
func WithNamespaces ¶
func WithNamespaces(namespaces ...string) ServerOption
WithNamespaces registers each namespace on Temporal start.
func WithPersistenceDisabled ¶
func WithPersistenceDisabled() ServerOption
WithPersistenceDisabled disables file persistence and uses the in-memory storage driver. State will be reset on each process restart.
func WithSQLitePragmas ¶
func WithSQLitePragmas(pragmas map[string]string) ServerOption
WithSQLitePragmas applies pragma statements to SQLite on Temporal start.
func WithSearchAttributeCacheDisabled ¶
func WithSearchAttributeCacheDisabled() ServerOption
WithSearchAttributeCacheDisabled disables search attribute caching. This delegates to WithDynamicConfigValue.
func WithUI ¶
func WithUI(server liteconfig.UIServer) ServerOption
WithUI enables the Temporal web interface.
When unspecified, Temporal will run in headless mode.
This option accepts a UIServer implementation in order to avoid bloating programs that do not need to embed the UI. See ./cmd/temporalite/main.go for an example of usage.
func WithUpstreamOptions ¶
func WithUpstreamOptions(options ...temporal.ServerOption) ServerOption
WithUpstreamOptions registers Temporal server options.