Documentation ¶
Index ¶
- Variables
- func ApplyClusterMetadataConfigProvider(logger log.Logger, config *config.Config, ...) (*cluster.Config, config.Persistence, error)
- func InterruptCh() <-chan interface{}
- func PersistenceFactoryProvider() persistenceClient.FactoryProviderFn
- func ServerLifetimeHooks(lc fx.Lifecycle, svr Server)
- func ServerOptionsProvider(opts []ServerOption) (serverOptionsProvider, error)
- func StopService(logger log.Logger, app *fx.App, svcName string, stopChan chan struct{})
- type Server
- type ServerFx
- type ServerImpl
- type ServerOption
- func ForServices(names []string) ServerOption
- func InterruptOn(interruptCh <-chan interface{}) ServerOption
- func WithAudienceGetter(audienceGetter func(cfg *config.Config) authorization.JWTAudienceMapper) ServerOption
- func WithAuthorizer(authorizer authorization.Authorizer) ServerOption
- func WithChainedFrontendGrpcInterceptors(interceptors ...grpc.UnaryServerInterceptor) ServerOption
- func WithClaimMapper(claimMapper func(cfg *config.Config) authorization.ClaimMapper) ServerOption
- func WithClientFactoryProvider(clientFactoryProvider client.FactoryProvider) ServerOption
- func WithConfig(cfg *config.Config) ServerOption
- func WithConfigLoader(configDir string, env string, zone string) ServerOption
- func WithCustomDataStoreFactory(customFactory persistenceclient.AbstractDataStoreFactory) ServerOption
- func WithCustomMetricsReporter(reporter metrics.Reporter) ServerOption
- func WithDynamicConfigClient(c dynamicconfig.Client) ServerOption
- func WithElasticsearchHttpClient(c *http.Client) ServerOption
- func WithLogger(logger log.Logger) ServerOption
- func WithNamespaceLogger(namespaceLogger log.Logger) ServerOption
- func WithPersistenceServiceResolver(r resolver.ServiceResolver) ServerOption
- func WithSearchAttributesMapper(m searchattribute.Mapper) ServerOption
- func WithTLSConfigFactory(tlsConfigProvider encryption.TLSConfigProvider) ServerOption
- type ServiceProviderParamsCommon
- type ServiceStopFn
- type ServicesGroupIn
- type ServicesGroupOut
- func FrontendServiceProvider(params ServiceProviderParamsCommon) (ServicesGroupOut, error)
- func HistoryServiceProvider(params ServiceProviderParamsCommon) (ServicesGroupOut, error)
- func MatchingServiceProvider(params ServiceProviderParamsCommon) (ServicesGroupOut, error)
- func WorkerServiceProvider(params ServiceProviderParamsCommon) (ServicesGroupOut, error)
- type ServicesMetadata
Constants ¶
This section is empty.
Variables ¶
var ServerFxImplModule = fx.Options( fx.Provide(NewServerFxImpl), fx.Provide(func(src *ServerImpl) Server { return src }), )
var ( Services = []string{ primitives.FrontendService, primitives.HistoryService, primitives.MatchingService, primitives.WorkerService, } )
Services is the list of all valid temporal services
Functions ¶
func ApplyClusterMetadataConfigProvider ¶ added in v1.14.0
func ApplyClusterMetadataConfigProvider( logger log.Logger, config *config.Config, persistenceServiceResolver resolver.ServiceResolver, persistenceFactoryProvider persistenceClient.FactoryProviderFn, customDataStoreFactory persistenceClient.AbstractDataStoreFactory, ) (*cluster.Config, config.Persistence, error)
ApplyClusterMetadataConfigProvider performs a config check against the configured persistence store for cluster metadata. If there is a mismatch, the persisted values take precedence and will be written over in the config objects. This is to keep this check hidden from downstream calls. TODO: move this to cluster.fx
func InterruptCh ¶
func InterruptCh() <-chan interface{}
func PersistenceFactoryProvider ¶ added in v1.16.0
func PersistenceFactoryProvider() persistenceClient.FactoryProviderFn
func ServerLifetimeHooks ¶ added in v1.14.0
func ServerOptionsProvider ¶ added in v1.14.0
func ServerOptionsProvider(opts []ServerOption) (serverOptionsProvider, error)
Types ¶
type Server ¶
type Server interface { Start() error Stop() }
func NewServer ¶
func NewServer(opts ...ServerOption) Server
NewServer returns a new instance of server that serves one or many services.
type ServerFx ¶ added in v1.14.0
type ServerFx struct {
// contains filtered or unexported fields
}
func NewServerFx ¶ added in v1.14.0
func NewServerFx(opts ...ServerOption) *ServerFx
type ServerImpl ¶ added in v1.14.0
type ServerImpl struct {
// contains filtered or unexported fields
}
ServerImpl is temporal server.
func NewServerFxImpl ¶ added in v1.14.0
func NewServerFxImpl( opts *serverOptions, logger log.Logger, namespaceLogger resource.NamespaceLogger, stoppedCh chan interface{}, dcCollection *dynamicconfig.Collection, serverReporter resource.ServerReporter, servicesGroup ServicesGroupIn, persistenceConfig config.Persistence, clusterMetadata *cluster.Config, persistenceFactoryProvider persistenceClient.FactoryProviderFn, ) *ServerImpl
NewServer returns a new instance of server that serves one or many services.
func (*ServerImpl) Start ¶ added in v1.14.0
func (s *ServerImpl) Start() error
Start temporal server. This function should be called only once, Server doesn't support multiple restarts.
type ServerOption ¶
type ServerOption interface {
// contains filtered or unexported methods
}
func ForServices ¶
func ForServices(names []string) ServerOption
ForServices indicates which supplied services (e.g. frontend, history, matching, worker) within the server to start
func InterruptOn ¶
func InterruptOn(interruptCh <-chan interface{}) ServerOption
InterruptOn interrupts server on the signal from server. If channel is nil Start() will block forever.
func WithAudienceGetter ¶ added in v1.10.3
func WithAudienceGetter(audienceGetter func(cfg *config.Config) authorization.JWTAudienceMapper) ServerOption
WithAudienceGetter configures JWT audience getter for authorization
func WithAuthorizer ¶
func WithAuthorizer(authorizer authorization.Authorizer) ServerOption
WithAuthorizer sets a low level authorizer to allow/deny all API calls
func WithChainedFrontendGrpcInterceptors ¶ added in v1.14.0
func WithChainedFrontendGrpcInterceptors( interceptors ...grpc.UnaryServerInterceptor, ) ServerOption
WithChainedFrontendGrpcInterceptors sets a chain of ordered custom grpc interceptors that will be invoked for all Frontend gRPC API calls. The list of custom interceptors will be appended to the end of the internal ServerInterceptors. The custom interceptors will be invoked in the order as they appear in the supplied list, after the internal ServerInterceptors.
func WithClaimMapper ¶ added in v1.4.0
func WithClaimMapper(claimMapper func(cfg *config.Config) authorization.ClaimMapper) ServerOption
WithClaimMapper configures a role mapper for authorization
func WithClientFactoryProvider ¶ added in v1.11.0
func WithClientFactoryProvider(clientFactoryProvider client.FactoryProvider) ServerOption
WithClientFactoryProvider sets a custom ClientFactoryProvider NOTE: this option is experimental and may be changed or removed in future release.
func WithConfig ¶
func WithConfig(cfg *config.Config) ServerOption
WithConfig sets a custom configuration
func WithConfigLoader ¶
func WithConfigLoader(configDir string, env string, zone string) ServerOption
WithConfigLoader sets a custom configuration load
func WithCustomDataStoreFactory ¶ added in v1.11.0
func WithCustomDataStoreFactory(customFactory persistenceclient.AbstractDataStoreFactory) ServerOption
WithCustomDataStoreFactory sets a custom AbstractDataStoreFactory NOTE: this option is experimental and may be changed or removed in future release.
func WithCustomMetricsReporter ¶ added in v1.4.0
func WithCustomMetricsReporter(reporter metrics.Reporter) ServerOption
WithCustomMetricsReporter sets custom metric reporter Detailed examples can be found at https://github.com/temporalio/samples-server
Sample usage: logger := log.NewCLILogger() mustProvider, err := NewCustomMustProviderImplementation(logger) reporter, err2 := metrics.NewOpentelemeteryReporter(logger, &metrics.ClientConfig{}, mustProvider) server := temporal.NewServer(temporal.WithCustomMetricsReporter(repoter))
func WithDynamicConfigClient ¶ added in v1.5.7
func WithDynamicConfigClient(c dynamicconfig.Client) ServerOption
WithDynamicConfigClient sets custom dynamic config client for reading dynamic configuration.
func WithElasticsearchHttpClient ¶ added in v1.5.7
func WithElasticsearchHttpClient(c *http.Client) ServerOption
WithElasticsearchHttpClient sets a custom HTTP client which is used to make requests to Elasticsearch
func WithLogger ¶ added in v1.5.7
func WithLogger(logger log.Logger) ServerOption
WithLogger sets a custom logger
func WithNamespaceLogger ¶ added in v1.11.0
func WithNamespaceLogger(namespaceLogger log.Logger) ServerOption
WithNamespaceLogger sets an optional logger for all frontend operations
func WithPersistenceServiceResolver ¶ added in v1.5.7
func WithPersistenceServiceResolver(r resolver.ServiceResolver) ServerOption
WithPersistenceServiceResolver sets a custom persistence service resolver which will convert service name or address value from config to another address
func WithSearchAttributesMapper ¶ added in v1.12.1
func WithSearchAttributesMapper(m searchattribute.Mapper) ServerOption
WithSearchAttributesMapper sets a custom search attributes mapper which converts search attributes aliases to field names and vice versa.
func WithTLSConfigFactory ¶
func WithTLSConfigFactory(tlsConfigProvider encryption.TLSConfigProvider) ServerOption
WithTLSConfigFactory overrides default provider of TLS configuration
type ServiceProviderParamsCommon ¶ added in v1.14.0
type ServiceProviderParamsCommon struct { fx.In Cfg *config.Config ServiceNames resource.ServiceNames Logger log.Logger NamespaceLogger resource.NamespaceLogger DynamicConfigClient dynamicconfig.Client ServerReporter resource.ServerReporter EsConfig *esclient.Config EsClient esclient.Client TlsConfigProvider encryption.TLSConfigProvider PersistenceConfig config.Persistence ClusterMetadata *cluster.Config ClientFactoryProvider client.FactoryProvider AudienceGetter authorization.JWTAudienceMapper PersistenceServiceResolver resolver.ServiceResolver PersistenceFactoryProvider persistenceClient.FactoryProviderFn SearchAttributesMapper searchattribute.Mapper CustomInterceptors []grpc.UnaryServerInterceptor Authorizer authorization.Authorizer ClaimMapper authorization.ClaimMapper DataStoreFactory persistenceClient.AbstractDataStoreFactory }
type ServiceStopFn ¶ added in v1.14.0
type ServiceStopFn func()
type ServicesGroupIn ¶ added in v1.14.0
type ServicesGroupIn struct { fx.In Services []*ServicesMetadata `group:"services"` }
type ServicesGroupOut ¶ added in v1.14.0
type ServicesGroupOut struct { fx.Out Services *ServicesMetadata `group:"services"` }
func FrontendServiceProvider ¶ added in v1.14.0
func FrontendServiceProvider( params ServiceProviderParamsCommon, ) (ServicesGroupOut, error)
func HistoryServiceProvider ¶ added in v1.14.0
func HistoryServiceProvider( params ServiceProviderParamsCommon, ) (ServicesGroupOut, error)
func MatchingServiceProvider ¶ added in v1.14.0
func MatchingServiceProvider( params ServiceProviderParamsCommon, ) (ServicesGroupOut, error)
func WorkerServiceProvider ¶ added in v1.14.0
func WorkerServiceProvider( params ServiceProviderParamsCommon, ) (ServicesGroupOut, error)
type ServicesMetadata ¶ added in v1.14.0
type ServicesMetadata struct { App *fx.App // Added for info. ServiceStopFn is enough. ServiceName string ServiceStopFn ServiceStopFn }