cmdoptions

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const AUTH_HEADER_ENV_VAR = "TEMPORAL_OMES_AUTH_HEADER"

Variables

View Source
var BackupLogger = log.New(os.Stderr, "", 0)

BackupLogger is used in case we can't instantiate zap (it's nicer DX than panicking or using built-in `log`).

Functions

This section is empty.

Types

type ClientOptions

type ClientOptions struct {
	// Address of Temporal server to connect to
	Address string
	// Temporal namespace
	Namespace string
	// Enable TLS
	EnableTLS bool
	// TLS client cert
	ClientCertPath string
	// TLS client private key
	ClientKeyPath string
	// Authorization header value
	AuthHeader string
}

Options for creating a Temporal client.

func (*ClientOptions) AddCLIFlags

func (c *ClientOptions) AddCLIFlags(fs *pflag.FlagSet)

AddCLIFlags adds the relevant flags to populate the options struct.

func (*ClientOptions) Dial

func (c *ClientOptions) Dial(metrics *Metrics, logger *zap.SugaredLogger) (client.Client, error)

Dial connects to a Temporal server, with logging, metrics, loaded TLS certs and set auth header.

func (*ClientOptions) MustDial

func (c *ClientOptions) MustDial(metrics *Metrics, logger *zap.SugaredLogger) client.Client

MustDial connects to a Temporal server, with logging, metrics and loaded TLS certs.

func (*ClientOptions) ToFlags

func (c *ClientOptions) ToFlags() (flags []string)

ToFlags converts these options to string flags.

type LoggingOptions

type LoggingOptions struct {
	// Log level
	LogLevel string
	// Log encoding (console json)
	LogEncoding string
}

LoggingOptions for setting up the logger component

func (*LoggingOptions) AddCLIFlags

func (l *LoggingOptions) AddCLIFlags(fs *pflag.FlagSet)

AddCLIFlags adds the relevant flags to populate the options struct.

func (*LoggingOptions) MustCreateLogger

func (l *LoggingOptions) MustCreateLogger() *zap.SugaredLogger

MustCreateLogger sets up a zap logger or panics on error.

func (*LoggingOptions) ToFlags

func (l *LoggingOptions) ToFlags() (flags []string)

ToFlags converts these options to string flags.

type Metrics

type Metrics struct {
	// contains filtered or unexported fields
}

Metrics is a component for insrumenting an application with Promethues metrics.

func (*Metrics) NewHandler

func (m *Metrics) NewHandler() client.MetricsHandler

Handler returns a new Temporal-client-compatible metrics handler.

func (*Metrics) Shutdown

func (m *Metrics) Shutdown(ctx context.Context) error

Shutdown the Promethus HTTP server if one was set up.

type MetricsOptions

type MetricsOptions struct {
	// Address for the Prometheus HTTP listener.
	// If empty, the listener will not be started.
	PrometheusListenAddress string
	// HTTP path for serving metrics.
	// Default "/metrics".
	PrometheusHandlerPath string
}

MetricsOptions for setting up Prometheus metrics.

func (*MetricsOptions) AddCLIFlags

func (m *MetricsOptions) AddCLIFlags(fs *pflag.FlagSet, prefix string)

AddCLIFlags adds the relevant flags to populate the options struct.

func (*MetricsOptions) MustCreateMetrics

func (m *MetricsOptions) MustCreateMetrics(logger *zap.SugaredLogger) *Metrics

MustCreateMetrics sets up Prometheus based metrics and starts an HTTP server for serving metrics.

func (*MetricsOptions) ToFlags

func (m *MetricsOptions) ToFlags() (flags []string)

ToFlags converts these options to string flags.

type PassThroughPayloadConverter

type PassThroughPayloadConverter struct{}

func (*PassThroughPayloadConverter) Encoding

func (p *PassThroughPayloadConverter) Encoding() string

func (*PassThroughPayloadConverter) FromPayload

func (p *PassThroughPayloadConverter) FromPayload(payload *common.Payload, valuePtr interface{}) error

func (*PassThroughPayloadConverter) ToPayload

func (p *PassThroughPayloadConverter) ToPayload(value interface{}) (*common.Payload, error)

func (*PassThroughPayloadConverter) ToString

func (p *PassThroughPayloadConverter) ToString(payload *common.Payload) string

type WorkerOptions

type WorkerOptions struct {
	MaxConcurrentActivityPollers int
	MaxConcurrentWorkflowPollers int
	MaxConcurrentActivities      int
	MaxConcurrentWorkflowTasks   int
}

WorkerOptions for setting up worker parameters

func (*WorkerOptions) AddCLIFlags

func (m *WorkerOptions) AddCLIFlags(fs *pflag.FlagSet, prefix string)

AddCLIFlags adds the relevant flags to populate the options struct.

func (*WorkerOptions) ToFlags

func (m *WorkerOptions) ToFlags() (flags []string)

ToFlags converts these options to string flags.

type ZapAdapter

type ZapAdapter struct {
	// contains filtered or unexported fields
}

func NewZapAdapter

func NewZapAdapter(zapLogger *zap.Logger) *ZapAdapter

func (*ZapAdapter) Debug

func (log *ZapAdapter) Debug(msg string, keyvals ...interface{})

func (*ZapAdapter) Error

func (log *ZapAdapter) Error(msg string, keyvals ...interface{})

func (*ZapAdapter) Info

func (log *ZapAdapter) Info(msg string, keyvals ...interface{})

func (*ZapAdapter) Warn

func (log *ZapAdapter) Warn(msg string, keyvals ...interface{})

func (*ZapAdapter) With

func (log *ZapAdapter) With(keyvals ...interface{}) log.Logger

Jump to

Keyboard shortcuts

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