Help us shape the future of Go! Take the 2026 Go Developer Survey

client

package
v0.19.1255 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(params Params) *Client

func (*Client) CreateEmitter

func (c *Client) CreateEmitter(ctx context.Context, req *CreateEmitterRequest) (*app.QueueEmitter, error)

@temporal-gen-v2 activity @start-to-close-timeout 2m

func (*Client) DeleteEmitter

func (c *Client) DeleteEmitter(ctx context.Context, emitterID string) error

@temporal-gen-v2 activity @start-to-close-timeout 1m

func (*Client) EnsureRunning

func (c *Client) EnsureRunning(ctx context.Context, emitterID string) (*emitter.EnsureRunningResponse, error)

func (*Client) GetEmittersByQueueID

func (c *Client) GetEmittersByQueueID(ctx context.Context, queueID string) ([]app.QueueEmitter, error)

@temporal-gen-v2 activity @start-to-close-timeout 1m

func (*Client) MigrateQueueEmitters added in v0.19.1091

func (c *Client) MigrateQueueEmitters(ctx context.Context, queueID string, newNamespace string) error

MigrateQueueEmitters moves every emitter of a queue to newNamespace. Each old-namespace emitter workflow is terminated (cross-namespace, so TERMINATE_IF_RUNNING on the restart is not enough), its DB row repointed, and the workflow restarted in the new namespace. Emitters already in newNamespace are skipped, so this is a no-op when nothing changed.

func (*Client) PauseEmitter

func (c *Client) PauseEmitter(ctx context.Context, emitterID string) (*app.QueueEmitter, error)

func (*Client) RestartEmitterWorkflow

func (c *Client) RestartEmitterWorkflow(ctx context.Context, emitterID string) (*app.QueueEmitter, error)

@temporal-gen-v2 activity @start-to-close-timeout 2m

func (*Client) ResumeEmitter

func (c *Client) ResumeEmitter(ctx context.Context, emitterID string) (*app.QueueEmitter, error)

func (*Client) StopEmitter added in v0.19.894

func (c *Client) StopEmitter(ctx context.Context, emitterID string) (*app.QueueEmitter, error)

@temporal-gen-v2 activity @start-to-close-timeout 2m

func (*Client) ToggleCronEmitters added in v0.19.1215

func (c *Client) ToggleCronEmitters(ctx context.Context, req *ToggleCronEmittersRequest) (*ToggleCronEmittersResponse, error)

func (*Client) ToggleCronEmittersForOwner added in v0.19.1214

@temporal-gen-v2 activity @start-to-close-timeout 2m

type CreateEmitterRequest

type CreateEmitterRequest struct {
	QueueID     string `validate:"required"`
	Name        string `validate:"required"`
	Description string

	// Mode determines if this is a recurring cron emitter or a one-shot scheduled emitter
	Mode app.QueueEmitterMode `validate:"required"`

	// For cron mode: the cron schedule expression (e.g., "0 * * * *")
	CronSchedule string
	// For cron mode: spread fire times deterministically across this window by
	// shifting the schedule's minute field (offset = hash(emitter ID) % window
	// minutes). Zero or sub-minute windows disable jitter.
	JitterWindow time.Duration
	// For scheduled mode: when to fire the signal
	ScheduledAt *time.Time

	SignalType      signal.SignalType `validate:"required"`
	SignalTemplate  signal.Signal
	SignalExpiresIn time.Duration
}

type Params

type Params struct {
	fx.In

	DB      *gorm.DB `name:"psql"`
	Cfg     *internal.Config
	TClient temporalclient.Client
	L       *zap.Logger
	MW      metrics.Writer
}

type ToggleCronEmittersForOwnerRequest added in v0.19.1214

type ToggleCronEmittersForOwnerRequest struct {
	OwnerID   string `validate:"required"`
	OwnerType string `validate:"required"`

	FromStatus app.Status `validate:"required"`
	ToStatus   app.Status `validate:"required"`
	Reason     string
}

type ToggleCronEmittersForOwnerResponse added in v0.19.1214

type ToggleCronEmittersForOwnerResponse struct {
	Changed    int      `json:"changed"`
	Errors     int      `json:"errors"`
	EmitterIDs []string `json:"emitter_ids"`
}

type ToggleCronEmittersRequest added in v0.19.1215

type ToggleCronEmittersRequest struct {
	OrgID         string
	InstallID     string
	Disable       bool
	Reason        string
	StopWorkflows bool
}

type ToggleCronEmittersResponse added in v0.19.1215

type ToggleCronEmittersResponse struct {
	Changed    int      `json:"changed"`
	Errors     int      `json:"errors"`
	EmitterIDs []string `json:"emitter_ids"`
}

Jump to

Keyboard shortcuts

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