temporal

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: MIT Imports: 42 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ServerFxImplModule = fx.Options(
	fx.Provide(NewServerFxImpl),
	fx.Provide(func(src *ServerImpl) Server { return src }),
)

Services is the list of all valid temporal services

Functions

func AbstractDatastoreFactoryProvider added in v1.14.0

func AbstractDatastoreFactoryProvider(so *serverOptions) persistenceClient.AbstractDataStoreFactory

func ApplyClusterMetadataConfigProvider added in v1.14.0

func ApplyClusterMetadataConfigProvider(
	logger log.Logger,
	config *config.Config,
	persistenceServiceResolver resolver.ServiceResolver,
	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 AuthorizerProvider added in v1.14.0

func AuthorizerProvider(so *serverOptions) authorization.Authorizer

func ClaimMapperProvider added in v1.14.0

func ClaimMapperProvider(so *serverOptions) authorization.ClaimMapper

func ClientFactoryProvider added in v1.14.0

func ClientFactoryProvider(so *serverOptions) client.FactoryProvider

func DcCollectionProvider added in v1.14.0

func DcCollectionProvider(dynamicConfigClient dynamicconfig.Client, logger log.Logger) *dynamicconfig.Collection

func DynamicConfigClientProvider added in v1.14.0

func DynamicConfigClientProvider(so *serverOptions, logger log.Logger, stoppedCh chan interface{}) (dynamicconfig.Client, error)

func ESConfigAndClientProvider added in v1.14.0

func ESConfigAndClientProvider(so *serverOptions, logger log.Logger) (*esclient.Config, esclient.Client, error)

func InterruptCh

func InterruptCh() <-chan interface{}

func JWTAudienceMapperProvider added in v1.14.0

func JWTAudienceMapperProvider(so *serverOptions) authorization.JWTAudienceMapper

func LoggerProvider added in v1.14.0

func LoggerProvider(so *serverOptions) log.Logger

func MetricReportersProvider added in v1.14.0

func MetricReportersProvider(so *serverOptions, logger log.Logger) (ServerReporter, SdkReporter, error)

func MetricsClientProvider added in v1.14.0

func MetricsClientProvider(logger log.Logger, serverReporter ServerReporter) (metrics.Client, error)

func SearchAttributeMapperProvider added in v1.14.0

func SearchAttributeMapperProvider(so *serverOptions) searchattribute.Mapper

func ServerLifetimeHooks added in v1.14.0

func ServerLifetimeHooks(
	lc fx.Lifecycle,
	svr Server,
)

func ServerOptionsProvider added in v1.14.0

func ServerOptionsProvider(opts []ServerOption) (*serverOptions, error)

func SoExpander added in v1.14.0

func SoExpander(so *serverOptions) (
	*config.PProf,
	*config.Config,
	resolver.ServiceResolver,
)

This is a place to expand SO Important note, persistence config and cluster metadata are later overriden via ApplyClusterMetadataConfigProvider.

func StopChanProvider added in v1.14.0

func StopChanProvider() chan interface{}

func TlsConfigProviderProvider added in v1.14.0

func TlsConfigProviderProvider(
	logger log.Logger,
	so *serverOptions,
	metricsClient metrics.Client,
) (encryption.TLSConfigProvider, error)

func UnaryInterceptorsProvider added in v1.14.0

func UnaryInterceptorsProvider(so *serverOptions) []grpc.UnaryServerInterceptor

Types

type NamespaceLogger added in v1.14.0

type NamespaceLogger log.Logger

func NamespaceLoggerProvider added in v1.14.0

func NamespaceLoggerProvider(so *serverOptions) NamespaceLogger

type SdkReporter added in v1.14.0

type SdkReporter metrics.Reporter

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

func (ServerFx) Start added in v1.14.0

func (s ServerFx) Start() error

func (ServerFx) Stop added in v1.14.0

func (s ServerFx) Stop()

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 NamespaceLogger,
	stoppedCh chan interface{},
	dynamicConfigClient dynamicconfig.Client,
	dcCollection *dynamicconfig.Collection,
	serverReporter ServerReporter,
	sdkReporter SdkReporter,
	servicesGroup ServicesGroupIn,
	persistenceConfig config.Persistence,
	clusterMetadata *cluster.Config,
) *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.

func (*ServerImpl) Stop added in v1.14.0

func (s *ServerImpl) Stop()

Stop stops the server.

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 interface{}) ServerOption

Set custom metric reporter for (deprecated) Tally it should be tally.BaseStatsReporter for Prometheus with framework metrics.FrameworkCustom it should be metrics.Reporter not used otherwise TODO: replace argument type with metrics.Reporter once tally is deprecated.

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 ServerReporter added in v1.14.0

type ServerReporter metrics.Reporter

type ServiceName added in v1.14.0

type ServiceName string

type ServiceNames added in v1.14.0

type ServiceNames map[string]struct{}

func ServiceNamesProvider added in v1.14.0

func ServiceNamesProvider(so *serverOptions) ServiceNames

type ServiceProviderParamsCommon added in v1.14.0

type ServiceProviderParamsCommon struct {
	fx.In

	Cfg                        *config.Config
	ServiceNames               ServiceNames
	Logger                     log.Logger
	NamespaceLogger            NamespaceLogger
	DynamicConfigClient        dynamicconfig.Client
	ServerReporter             ServerReporter
	SdkReporter                SdkReporter
	EsConfig                   *esclient.Config
	EsClient                   esclient.Client
	TlsConfigProvider          encryption.TLSConfigProvider
	PersistenceConfig          config.Persistence
	ClusterMetadata            *cluster.Config
	ClientFactoryProvider      client.FactoryProvider
	AudienceGetter             authorization.JWTAudienceMapper
	PersistenceServiceResolver resolver.ServiceResolver
	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
}

Jump to

Keyboard shortcuts

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