server

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 25 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServerCommands

func NewServerCommands(defaultCfg *sconfig.Config) []*cli.Command

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

func (s *Server) FrontendHostPort() string

FrontendHostPort returns the host:port for this server.

When constructing a Temporal client from within the same process, NewClient or NewClientWithOptions should be used instead.

func (*Server) NewClient

func (s *Server) NewClient(ctx context.Context, namespace string) (client.Client, error)

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.

func (*Server) Start

func (s *Server) Start() error

Start temporal server.

func (*Server) Stop

func (s *Server) Stop()

Stop the server.

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 WithCustomClusterID added in v0.4.0

func WithCustomClusterID(clusterID string) ServerOption

WithCustomClusterID explicitly sets the cluster ID to use.

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 WithFrontendHTTPPort added in v0.10.6

func WithFrontendHTTPPort(port int) ServerOption

WithFrontendPort sets the listening port for the temporal-frontend HTTP service.

When unspecified or 0, the HTTP service will be disabled.

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 WithPersistenceQPS added in v0.10.1

func WithPersistenceQPS() ServerOption

WithPersistenceQPS sets an increased default persistence QPS. Addresses occasional QPS related errors in UI. This delegates to WithDynamicConfigValue.

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 sconfig.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/temporal/main.go for an example of usage.

func WithUpstreamOptions

func WithUpstreamOptions(options ...temporal.ServerOption) ServerOption

WithUpstreamOptions registers Temporal server options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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