factory

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: BSD-2-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCommandSender

func CreateCommandSender(
	syncProducer libkafka.SyncProducer,
	branch cqrsbase.Branch,
	dryRun bool,
) task.CreateCommandSender

CreateCommandSender builds the task.CreateCommandSender. When dryRun is true, returns a no-op sender. Pure plumbing.

func CreateHealthzHandler

func CreateHealthzHandler() http.Handler

CreateHealthzHandler returns the liveness-probe HTTP handler. Pure plumbing.

func CreatePublisher

func CreatePublisher(sender task.CreateCommandSender, dryRun bool) publisher.Publisher

CreatePublisher builds a publisher.Publisher that sends through the given task.CreateCommandSender. When dryRun is true, the publisher logs the would-be CreateCommand and skips the sender call. Pure plumbing: no business logic.

func CreateScheduleStore

func CreateScheduleStore(
	client versioned.Interface,
	namespace string,
) (externalversions.SharedInformerFactory, store.ScheduleStore)

CreateScheduleStore builds the informer-backed ScheduleStore for the given namespace. The caller is responsible for starting the returned factory (StartWithContext) and waiting for cache sync before reading.

func CreateTick

func CreateTick(
	ctx context.Context,
	scheduleStore store.ScheduleStore,
	pub publisher.Publisher,
	clock libtime.CurrentDateTimeGetter,
	metrics tick.Metrics,
) tick.Tick

CreateTick builds the hourly cron loop. scheduleStore provides the current recurring-task definitions per tick; pub sends one CreateCommand per inventory entry; clock is the wall-clock source; metrics records per-publish outcomes and the tick-start timestamp.

NewTick can fail at construction time if time.LoadLocation("Europe/Berlin") fails (tzdata missing from the container image). That is a container-build bug, not a runtime fault — CreateTick panics with a wrapped error if it happens. The binary will CrashLoopBackOff with the tzdata error visible in the pod logs.

func CreateTickLoop

func CreateTickLoop(
	ctx context.Context,
	scheduleStore store.ScheduleStore,
	syncProducer libkafka.SyncProducer,
	branch cqrsbase.Branch,
	dryRun bool,
) tick.Tick

CreateTickLoop builds a one-shot tick loop for cmd/run-once. It wires the store, publisher, clock, and metrics then delegates to CreateTick.

func CreateTriggerHandler

func CreateTriggerHandler(scheduleStore store.ScheduleStore, pub publisher.Publisher) http.Handler

CreateTriggerHandler returns the operator-replay HTTP handler. The handler reads the current task definitions from scheduleStore, date-filters them via schedule.TasksForDate(all, date) (slug-sorted), and calls publisher.Publish for each entry against the parsed date. Pure plumbing: no business logic, no closure capture, no state.

Types

This section is empty.

Jump to

Keyboard shortcuts

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