Documentation ¶
Index ¶
- Constants
- func ListenIP() (net.IP, error)
- func Load(env string, configDir string, zone string, config interface{}) error
- type Archival
- type ArchivalNamespaceDefaults
- type Cassandra
- type CassandraConsistencySettings
- type CassandraStoreConsistency
- type ClientTLS
- type ClusterInformation
- type ClusterMetadata
- type Config
- type CustomDatastoreConfig
- type DCRedirectionPolicy
- type DataStore
- type FilestoreArchiver
- type Global
- type GroupTLS
- type GstorageArchiver
- type HistoryArchival
- type HistoryArchivalNamespaceDefaults
- type HistoryArchiverProvider
- type Logger
- type Membership
- type Metrics
- type NamespaceDefaults
- type PProf
- type PProfInitializerImpl
- type Persistence
- type PublicClient
- type RPC
- type ReplicationConsumerConfig
- type ReplicationTaskProcessorConfig
- type Replicator
- type RootTLS
- type S3Archiver
- type SQL
- type ServerTLS
- type Service
- type Statsd
- type VisibilityArchival
- type VisibilityArchivalNamespaceDefaults
- type VisibilityArchiverProvider
- type VisibilityConfig
Constants ¶
const ( // ReplicationConsumerTypeKafka means consuming replication tasks from kafka. ReplicationConsumerTypeKafka = "kafka" // ReplicationConsumerTypeRPC means pulling source DC for replication tasks. ReplicationConsumerTypeRPC = "rpc" )
const ( // EnvKeyRoot the environment variable key for runtime root dir EnvKeyRoot = "TEMPORAL_ROOT" // EnvKeyConfigDir the environment variable key for config dir EnvKeyConfigDir = "TEMPORAL_CONFIG_DIR" // EnvKeyEnvironment is the environment variable key for environment EnvKeyEnvironment = "TEMPORAL_ENVIRONMENT" // EnvKeyAvailabilityZone is the environment variable key for AZ EnvKeyAvailabilityZone = "TEMPORAL_AVAILABILTY_ZONE" )
const ( // StoreTypeSQL refers to sql based storage as persistence store StoreTypeSQL = "sql" // StoreTypeNoSQL refers to nosql based storage as persistence store StoreTypeNoSQL = "nosql" )
Variables ¶
This section is empty.
Functions ¶
func ListenIP ¶ added in v0.3.2
ListenIP returns the IP to bind to in Listen. It tries to find an IP that can be used by other machines to reach this machine.
func Load ¶
Load loads the configuration from a set of yaml config files found in the config directory
The loader first fetches the set of files matching a pre-determined naming convention, then sorts them by hierarchy order and after that, simply loads the files one after another with the key/values in the later files overriding the key/values in the earlier files
The hierarchy is as follows from lowest to highest
base.yaml env.yaml -- environment is one of the input params ex-development env_az.yaml -- zone is another input param
Types ¶
type Archival ¶ added in v0.5.0
type Archival struct { // History is the config for the history archival History HistoryArchival `yaml:"history"` // Visibility is the config for visibility archival Visibility VisibilityArchival `yaml:"visibility"` }
Archival contains the config for archival
func (*Archival) Validate ¶ added in v0.8.3
func (a *Archival) Validate(namespaceDefaults *ArchivalNamespaceDefaults) error
Validate validates the archival config
type ArchivalNamespaceDefaults ¶ added in v0.27.0
type ArchivalNamespaceDefaults struct { // History is the namespace default history archival config for each namespace History HistoryArchivalNamespaceDefaults `yaml:"history"` // Visibility is the namespace default visibility archival config for each namespace Visibility VisibilityArchivalNamespaceDefaults `yaml:"visibility"` }
ArchivalNamespaceDefaults is the default archival config for each namespace
type Cassandra ¶
type Cassandra struct { // Hosts is a csv of cassandra endpoints Hosts string `yaml:"hosts" validate:"nonzero"` // Port is the cassandra port used for connection by gocql client Port int `yaml:"port"` // User is the cassandra user used for authentication by gocql client User string `yaml:"user"` // Password is the cassandra password used for authentication by gocql client Password string `yaml:"password"` // keyspace is the cassandra keyspace Keyspace string `yaml:"keyspace" validate:"nonzero"` // Datacenter is the data center filter arg for cassandra Datacenter string `yaml:"datacenter"` // MaxConns is the max number of connections to this datastore for a single keyspace MaxConns int `yaml:"maxConns"` // ConnectTimeout is a timeout for initial dial to cassandra server (default: 600 milliseconds) ConnectTimeout time.Duration `yaml:"connectTimeout"` // TLS configuration TLS *auth.TLS `yaml:"tls"` // Consistency configuration (defaults to LOCAL_QUORUM / LOCAL_SERIAL for all stores if this field not set) Consistency *CassandraStoreConsistency `yaml:"consistency"` }
Cassandra contains configuration to connect to Cassandra cluster
type CassandraConsistencySettings ¶ added in v0.27.0
type CassandraConsistencySettings struct { // Consistency sets the default consistency level. Values identical to gocql Consistency values. (defaults to LOCAL_QUORUM if not set). Consistency string `yaml:"consistency"` // SerialConsistency sets the consistency for the serial prtion of queries. Values identical to gocql SerialConsistency values. (defaults to LOCAL_SERIAL if not set) SerialConsistency string `yaml:"serialConsistency"` }
CassandraConsistencySettings sets the default consistency level for regular & serial queries to Cassandra.
type CassandraStoreConsistency ¶ added in v0.27.0
type CassandraStoreConsistency struct { // Default defines the consistency level for ALL stores. // Defaults to LOCAL_QUORUM and LOCAL_SERIAL if not set Default *CassandraConsistencySettings `yaml:"default"` }
CassandraStoreConsistency enables you to set the consistency settings for each Cassandra Persistence Store for Temporal
func (*CassandraStoreConsistency) GetConsistency ¶ added in v0.27.0
func (c *CassandraStoreConsistency) GetConsistency() gocql.Consistency
GetConsistency returns the gosql.Consistency setting from the configuration for the given store type
func (*CassandraStoreConsistency) GetSerialConsistency ¶ added in v0.27.0
func (c *CassandraStoreConsistency) GetSerialConsistency() gocql.SerialConsistency
GetSerialConsistency returns the gosql.SerialConsistency setting from the configuration for the store
type ClientTLS ¶ added in v0.27.0
type ClientTLS struct { // DNS name to validate against for server to server connections. // Required when TLS is enabled in a multi-host cluster. // This name should be referenced by the certificate specified in the ServerTLS section. ServerName string `yaml:"serverName"` // Optional - A list of paths to files containing the PEM-encoded public key of the Certificate Authorities you wish to trust. RootCAFiles []string `yaml:"rootCaFiles"` }
ClientTLS contains TLS configuration for clients.
type ClusterInformation ¶ added in v0.5.8
type ClusterInformation struct { Enabled bool `yaml:"enabled"` InitialFailoverVersion int64 `yaml:"initialFailoverVersion"` // TODO: remove RPCName (not used with gRPC) // RPCName indicate the remote service name RPCName string `yaml:"rpcName"` // Address indicate the remote service address(Host:Port). Host can be DNS name. RPCAddress string `yaml:"rpcAddress"` }
ClusterInformation contains the information about each cluster which participated in cross DC
type ClusterMetadata ¶ added in v0.5.8
type ClusterMetadata struct { EnableGlobalNamespace bool `yaml:"enableGlobalNamespace"` // ReplicationConsumerConfig determines how we consume replication tasks. ReplicationConsumer *ReplicationConsumerConfig `yaml:"replicationConsumer"` // FailoverVersionIncrement is the increment of each cluster version when failover happens FailoverVersionIncrement int64 `yaml:"failoverVersionIncrement"` // MasterClusterName is the master cluster name, only the master cluster can register / update namespace // all clusters can do namespace failover MasterClusterName string `yaml:"masterClusterName"` // CurrentClusterName is the name of the current cluster CurrentClusterName string `yaml:"currentClusterName"` // ClusterInformation contains all cluster names to corresponding information about that cluster ClusterInformation map[string]ClusterInformation `yaml:"clusterInformation"` }
ClusterMetadata contains the all cluster which participated in cross DC
type Config ¶
type Config struct { // Global is process-wide service-related configuration Global Global `yaml:"global"` // Persistence contains the configuration for temporal datastores Persistence Persistence `yaml:"persistence"` // Log is the logging config Log Logger `yaml:"log"` // ClusterMetadata is the config containing all valid clusters and active cluster ClusterMetadata *ClusterMetadata `yaml:"clusterMetadata"` // DCRedirectionPolicy contains the frontend datacenter redirection policy DCRedirectionPolicy DCRedirectionPolicy `yaml:"dcRedirectionPolicy"` // Services is a map of service name to service config items Services map[string]Service `yaml:"services"` // Kafka is the config for connecting to kafka Kafka messaging.KafkaConfig `yaml:"kafka"` // Archival is the config for archival Archival Archival `yaml:"archival"` // PublicClient is config for connecting to temporal frontend PublicClient PublicClient `yaml:"publicClient"` // DynamicConfigClient is the config for setting up the file based dynamic config client // Filepath should be relative to the root directory DynamicConfigClient dynamicconfig.FileBasedClientConfig `yaml:"dynamicConfigClient"` // NamespaceDefaults is the default config for every namespace NamespaceDefaults NamespaceDefaults `yaml:"namespaceDefaults"` }
Config contains the configuration for a set of temporal services
type CustomDatastoreConfig ¶ added in v0.27.0
type CustomDatastoreConfig struct { // Name of the custom datastore Name string `yaml:"name"` // Options is a set of key-value attributes that can be used by AbstractDatastoreFactory implementation Options map[string]string `yaml:"options"` }
CustomDatastoreConfig is the configuration for connecting to a custom datastore that is not supported by temporal core
type DCRedirectionPolicy ¶ added in v0.5.2
DCRedirectionPolicy contains the frontend datacenter redirection policy
type DataStore ¶ added in v0.4.0
type DataStore struct { // Cassandra contains the config for a cassandra datastore Cassandra *Cassandra `yaml:"cassandra"` // SQL contains the config for a SQL based datastore SQL *SQL `yaml:"sql"` // Custom contains the config for custom datastore implementation CustomDataStoreConfig *CustomDatastoreConfig `yaml:"customDatastore"` // ElasticSearch contains the config for a ElasticSearch datastore ElasticSearch *elasticsearch.Config `yaml:"elasticsearch"` }
DataStore is the configuration for a single datastore
type FilestoreArchiver ¶ added in v0.27.0
FilestoreArchiver contain the config for filestore archiver
type Global ¶ added in v0.27.0
type Global struct { // Membership is the ringpop related configuration Membership Membership `yaml:"membership"` // PProf is the PProf configuration PProf PProf `yaml:"pprof"` // TLS controls the communication encryption configuration TLS RootTLS `yaml:"tls"` }
Global contains config items that apply process-wide to all services
type GroupTLS ¶ added in v0.27.0
type GroupTLS struct { // Client handles client TLS settings Client ClientTLS `yaml:"client"` // Server handles the server (listener) TLS settings Server ServerTLS `yaml:"server"` }
GroupTLS contains an instance client and server TLS settings
type GstorageArchiver ¶ added in v0.27.0
type GstorageArchiver struct {
CredentialsPath string `yaml:"credentialsPath"`
}
GstorageArchiver contain the config for google storage archiver
type HistoryArchival ¶ added in v0.7.0
type HistoryArchival struct { // State is the state of history archival either: enabled, disabled, or paused State string `yaml:"state"` // EnableRead whether history can be read from archival EnableRead bool `yaml:"enableRead"` // Provider contains the config for all history archivers Provider *HistoryArchiverProvider `yaml:"provider"` }
HistoryArchival contains the config for history archival
type HistoryArchivalNamespaceDefaults ¶ added in v0.27.0
type HistoryArchivalNamespaceDefaults struct { // State is the namespace default state of history archival: enabled or disabled State string `yaml:"state"` // URI is the namespace default URI for history archiver URI string `yaml:"URI"` }
HistoryArchivalNamespaceDefaults is the default history archival config for each namespace
type HistoryArchiverProvider ¶ added in v0.7.0
type HistoryArchiverProvider struct { Filestore *FilestoreArchiver `yaml:"filestore"` Gstorage *GstorageArchiver `yaml:"gstorage"` S3store *S3Archiver `yaml:"s3store"` }
HistoryArchiverProvider contains the config for all history archivers
type Logger ¶
type Logger struct { // Stdout is true if the output needs to goto standard out Stdout bool `yaml:"stdout"` // Level is the desired log level Level string `yaml:"level"` // OutputFile is the path to the log output file OutputFile string `yaml:"outputFile"` }
Logger contains the config items for logger
func (*Logger) NewZapLogger ¶ added in v0.5.7
NewZapLogger builds and returns a new zap logger for this logging configuration
type Membership ¶ added in v0.27.0
type Membership struct { // MaxJoinDuration is the max wait time to join the gossip ring MaxJoinDuration time.Duration `yaml:"maxJoinDuration"` // BroadcastAddress is used as the address that is communicated to remote nodes to connect on. // This is generally used when BindOnIP would be the same across several nodes (ie: 0.0.0.0) // and for nat traversal scenarios. Check net.ParseIP for supported syntax, only IPv4 is supported. BroadcastAddress string `yaml:"broadcastAddress"` }
Membership contains config items related to the membership layer of temporal
type Metrics ¶
type Metrics struct { // M3 is the configuration for m3 metrics reporter M3 *m3.Configuration `yaml:"m3"` // Statsd is the configuration for statsd reporter Statsd *Statsd `yaml:"statsd"` // Prometheus is the configuration for prometheus reporter Prometheus *prometheus.Configuration `yaml:"prometheus"` // Tags is the set of key-value pairs to be reported // as part of every metric Tags map[string]string `yaml:"tags"` // Prefix sets the prefix to all outgoing metrics Prefix string `yaml:"prefix"` }
Metrics contains the config items for metrics subsystem
type NamespaceDefaults ¶ added in v0.27.0
type NamespaceDefaults struct { // Archival is the default archival config for each namespace Archival ArchivalNamespaceDefaults `yaml:"archival"` }
NamespaceDefaults is the default config for each namespace
type PProf ¶ added in v0.3.5
type PProf struct { // Port is the port on which the PProf will bind to Port int `yaml:"port"` }
PProf contains the config items for the pprof utility
func (*PProf) NewInitializer ¶ added in v0.3.5
func (cfg *PProf) NewInitializer(logger log.Logger) *PProfInitializerImpl
NewInitializer create a new instance of PProf Initializer
type PProfInitializerImpl ¶ added in v0.3.5
PProfInitializerImpl initialize the pprof based on config
func (*PProfInitializerImpl) Start ¶ added in v0.3.5
func (initializer *PProfInitializerImpl) Start() error
Start the pprof based on config
type Persistence ¶ added in v0.4.0
type Persistence struct { // DefaultStore is the name of the default data store to use DefaultStore string `yaml:"defaultStore" validate:"nonzero"` // VisibilityStore is the name of the datastore to be used for visibility records VisibilityStore string `yaml:"visibilityStore" validate:"nonzero"` // AdvancedVisibilityStore is the name of the datastore to be used for visibility records AdvancedVisibilityStore string `yaml:"advancedVisibilityStore"` // HistoryMaxConns is the desired number of conns to history store. Value specified // here overrides the MaxConns config specified as part of datastore HistoryMaxConns int `yaml:"historyMaxConns"` // NumHistoryShards is the desired number of history shards. This config doesn't // belong here, needs refactoring NumHistoryShards int32 `yaml:"numHistoryShards" validate:"nonzero"` // DataStores contains the configuration for all datastores DataStores map[string]DataStore `yaml:"datastores"` // VisibilityConfig is config for visibility sampling VisibilityConfig *VisibilityConfig `yaml:"-" json:"-"` // TransactionSizeLimit is the largest allowed transaction size TransactionSizeLimit dynamicconfig.IntPropertyFn `yaml:"-" json:"-"` }
Persistence contains the configuration for data store / persistence layer
func (*Persistence) DefaultStoreType ¶ added in v0.5.7
func (c *Persistence) DefaultStoreType() string
DefaultStoreType returns the storeType for the default persistence store
func (*Persistence) IsAdvancedVisibilityConfigExist ¶ added in v0.27.0
func (c *Persistence) IsAdvancedVisibilityConfigExist() bool
IsAdvancedVisibilityConfigExist returns whether user specified advancedVisibilityStore in config
func (*Persistence) Validate ¶ added in v0.4.0
func (c *Persistence) Validate() error
Validate validates the persistence config
type PublicClient ¶ added in v0.5.7
type PublicClient struct { // HostPort is the host port to connect on. Host can be DNS name HostPort string `yaml:"hostPort" validate:"nonzero"` // interval to refresh DNS. Default to 10s RefreshInterval time.Duration `yaml:"RefreshInterval"` }
PublicClient is config for connecting to temporal frontend
type RPC ¶ added in v0.3.2
type RPC struct { // GRPCPort is the port on which gRPC will listen GRPCPort int `yaml:"grpcPort"` // Port used for membership listener MembershipPort int `yaml:"membershipPort"` // BindOnLocalHost is true if localhost is the bind address BindOnLocalHost bool `yaml:"bindOnLocalHost"` // BindOnIP can be used to bind service on specific ip (eg. `0.0.0.0`) - // check net.ParseIP for supported syntax, only IPv4 is supported, // mutually exclusive with `BindOnLocalHost` option BindOnIP string `yaml:"bindOnIP"` }
RPC contains the rpc config items
type ReplicationConsumerConfig ¶ added in v0.27.0
type ReplicationConsumerConfig struct { // Type determines how we consume replication tasks. It can be either kafka(default) or rpc. Type string `yaml:"type"` }
ReplicationConsumerConfig contains config for replication consumer
type ReplicationTaskProcessorConfig ¶ added in v0.27.0
type ReplicationTaskProcessorConfig struct { NoTaskInitialWaitIntervalSecs int `yaml:"noTaskInitialWaitIntervalSecs"` NoTaskWaitBackoffCoefficient float64 `yaml:"noTaskWaitBackoffCoefficient"` NoTaskMaxWaitIntervalSecs int `yaml:"noTaskMaxWaitIntervalSecs"` }
ReplicationTaskProcessorConfig is the config for replication task processor.
type Replicator ¶ added in v0.3.7
type Replicator struct{}
Replicator describes the configuration of replicator
type RootTLS ¶ added in v0.27.0
type RootTLS struct { // Internode controls backend service communication TLS settings. Internode GroupTLS `yaml:"internode"` // Frontend controls SDK Client to Frontend communication TLS settings. Frontend GroupTLS `yaml:"frontend"` }
RootTLS contains all TLS settings for the Temporal server
type S3Archiver ¶ added in v0.27.0
type S3Archiver struct { Region string `yaml:"region"` Endpoint *string `yaml:"endpoint"` S3ForcePathStyle bool `yaml:"s3ForcePathStyle"` }
S3Archiver contains the config for S3 archiver
type SQL ¶ added in v0.4.0
type SQL struct { // User is the username to be used for the conn User string `yaml:"user"` // Password is the password corresponding to the user name Password string `yaml:"password"` // PluginName is the name of SQL plugin PluginName string `yaml:"pluginName" validate:"nonzero"` // DatabaseName is the name of SQL database to connect to DatabaseName string `yaml:"databaseName" validate:"nonzero"` // ConnectAddr is the remote addr of the database ConnectAddr string `yaml:"connectAddr" validate:"nonzero"` // ConnectProtocol is the protocol that goes with the ConnectAddr ex - tcp, unix ConnectProtocol string `yaml:"connectProtocol" validate:"nonzero"` // ConnectAttributes is a set of key-value attributes to be sent as part of connect data_source_name url ConnectAttributes map[string]string `yaml:"connectAttributes"` // MaxConns the max number of connections to this datastore MaxConns int `yaml:"maxConns"` // MaxIdleConns is the max number of idle connections to this datastore MaxIdleConns int `yaml:"maxIdleConns"` // MaxConnLifetime is the maximum time a connection can be alive MaxConnLifetime time.Duration `yaml:"maxConnLifetime"` // EXPERIMENTAL - TaskScanPartitions is the number of partitions to sequentially scan during ListTaskQueue operations. // This is used for in a sharded sql database such as Vitess for heavy task workloads to minimize scatter gather. // The default value for this param is 1, and should not be configured without a thorough understanding of what this does. TaskScanPartitions int `yaml:"taskScanPartitions"` // TLS is the configuration for TLS connections TLS *auth.TLS `yaml:"tls"` }
SQL is the configuration for connecting to a SQL backed datastore
type ServerTLS ¶ added in v0.27.0
type ServerTLS struct { // The path to the file containing the PEM-encoded public key of the certificate to use. CertFile string `yaml:"certFile"` // The path to the file containing the PEM-encoded private key of the certificate to use. KeyFile string `yaml:"keyFile"` // A list of paths to files containing the PEM-encoded public key of the Certificate Authorities you wish to trust for client authentication. // This value is ignored if `requireClientAuth` is not enabled. ClientCAFiles []string `yaml:"clientCaFiles"` // Requires clients to authenticate with a certificate when connecting, otherwise known as mutual TLS. RequireClientAuth bool `yaml:"requireClientAuth"` }
ServerTLS contains items to load server TLS configuration
type Service ¶
type Service struct { // RPC is the rpc configuration RPC RPC `yaml:"rpc"` // Metrics is the metrics subsystem configuration Metrics Metrics `yaml:"metrics"` }
Service contains the service specific config items
type Statsd ¶
type Statsd struct { // The host and port of the statsd server HostPort string `yaml:"hostPort" validate:"nonzero"` // The prefix to use in reporting to statsd Prefix string `yaml:"prefix" validate:"nonzero"` // FlushInterval is the maximum interval for sending packets. // If it is not specified, it defaults to 1 second. FlushInterval time.Duration `yaml:"flushInterval"` // FlushBytes specifies the maximum udp packet size you wish to send. // If FlushBytes is unspecified, it defaults to 1432 bytes, which is // considered safe for local traffic. FlushBytes int `yaml:"flushBytes"` }
Statsd contains the config items for statsd metrics reporter
type VisibilityArchival ¶ added in v0.7.0
type VisibilityArchival struct { // State is the state of visibility archival either: enabled, disabled, or paused State string `yaml:"state"` // EnableRead whether visibility can be read from archival EnableRead bool `yaml:"enableRead"` // Provider contains the config for all visibility archivers Provider *VisibilityArchiverProvider `yaml:"provider"` }
VisibilityArchival contains the config for visibility archival
type VisibilityArchivalNamespaceDefaults ¶ added in v0.27.0
type VisibilityArchivalNamespaceDefaults struct { // State is the namespace default state of visibility archival: enabled or disabled State string `yaml:"state"` // URI is the namespace default URI for visibility archiver URI string `yaml:"URI"` }
VisibilityArchivalNamespaceDefaults is the default visibility archival config for each namespace
type VisibilityArchiverProvider ¶ added in v0.7.0
type VisibilityArchiverProvider struct { Filestore *FilestoreArchiver `yaml:"filestore"` S3store *S3Archiver `yaml:"s3store"` Gstorage *GstorageArchiver `yaml:"gstorage"` }
VisibilityArchiverProvider contains the config for all visibility archivers
type VisibilityConfig ¶ added in v0.5.3
type VisibilityConfig struct { // EnableSampling for visibility EnableSampling dynamicconfig.BoolPropertyFn `yaml:"-" json:"-"` // VisibilityOpenMaxQPS max QPS for record open workflows VisibilityOpenMaxQPS dynamicconfig.IntPropertyFnWithNamespaceFilter `yaml:"-" json:"-"` // VisibilityClosedMaxQPS max QPS for record closed workflows VisibilityClosedMaxQPS dynamicconfig.IntPropertyFnWithNamespaceFilter `yaml:"-" json:"-"` // VisibilityListMaxQPS max QPS for list workflow VisibilityListMaxQPS dynamicconfig.IntPropertyFnWithNamespaceFilter `yaml:"-" json:"-"` // ESIndexMaxResultWindow ElasticSearch index setting max_result_window ESIndexMaxResultWindow dynamicconfig.IntPropertyFn `yaml:"-" json:"-"` // MaxQPS is overall max QPS MaxQPS dynamicconfig.IntPropertyFn `yaml:"-" json:"-"` // ValidSearchAttributes is legal indexed keys that can be used in list APIs ValidSearchAttributes dynamicconfig.MapPropertyFn `yaml:"-" json:"-"` }
VisibilityConfig is config for visibility sampling