Documentation ¶
Overview ¶
Package temporalclient provides functionality to create and initialize a client for Temporal, a distributed, scalable, durable, and highly available orchestration engine. This package supports configuration with optional mutual TLS (mTLS) for enhanced security.
The main components are the TemporalConfig struct and the NewTemporalClient function, which uses the configuration to create a Temporal client.
Index ¶
- Variables
- type TemporalConfig
- type TemporalExecutorClient
- type TemporalOption
- func WithCertPath(certPath string) TemporalOption
- func WithHostPort(hostPort string) TemporalOption
- func WithKeyPath(keyPath string) TemporalOption
- func WithLogger(logger *zap.Logger) TemporalOption
- func WithMtlsEnabled(mtlsEnabled bool) TemporalOption
- func WithNamespace(namespace string) TemporalOption
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type TemporalConfig ¶
type TemporalConfig struct { ClientKeyPath string // Path to the TLS key file ClientCertPath string // Path to the TLS certificate file Namespace string // Temporal namespace HostPort string // Host and port of the Temporal service MtlsEnabled bool // Flag to enable mTLS Logger *zap.Logger // Logger }
TemporalConfig holds the configuration necessary for setting up a Temporal client. This includes the paths to the TLS certificate and key, the Temporal namespace, the host and port information, and a flag to enable mTLS.
func NewTemporalConfig ¶
func NewTemporalConfig(opts ...TemporalOption) (*TemporalConfig, error)
NewTemporalConfig creates a new instance of TemporalConfig with the provided parameters. This function is a convenient way to create a configuration with all necessary details.
Example:
config := NewTemporalConfig("./ca.key", "./ca.pem", "example_namespace", "localhost:7233", true)
type TemporalExecutorClient ¶
func New ¶
func New(config *TemporalConfig) (*TemporalExecutorClient, error)
New creates and initializes a new Temporal client using the provided TemporalConfig. This function handles the setup of mTLS based on the configuration and returns an initialized client.
Example:
config := NewTemporalConfig("./ca.key", "./ca.pem", "example_namespace", "localhost:7233", true) client, err := NewTemporalClient(config) if err != nil { log.Fatal(err) } defer client.Close() // Use the client...
func (*TemporalExecutorClient) Close ¶
func (c *TemporalExecutorClient) Close()
Close closes the Temporal client.
type TemporalOption ¶
type TemporalOption func(*TemporalConfig)
TemporalOption defines a type for functional options.
func WithCertPath ¶
func WithCertPath(certPath string) TemporalOption
WithCertPath sets the client certificate path.
func WithHostPort ¶
func WithHostPort(hostPort string) TemporalOption
WithPort sets the Temporal port.
func WithKeyPath ¶
func WithKeyPath(keyPath string) TemporalOption
WithKeyPath sets the client key path.
func WithLogger ¶
func WithLogger(logger *zap.Logger) TemporalOption
func WithMtlsEnabled ¶
func WithMtlsEnabled(mtlsEnabled bool) TemporalOption
func WithNamespace ¶
func WithNamespace(namespace string) TemporalOption
WithNamespace sets the Temporal namespace.
Directories ¶
Path | Synopsis |
---|---|
Package scheduleclient provides functionalities to interact with a scheduling service, such as creating and managing scheduled tasks.
|
Package scheduleclient provides functionalities to interact with a scheduling service, such as creating and managing scheduled tasks. |