task

package
v0.62.5 Latest Latest
Warning

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

Go to latest
Published: May 14, 2026 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const CreateCommandOperation base.CommandOperation = "create-task"

CreateCommandOperation is the Kafka command operation for creating a new vault task. Wire string unchanged: "create-task".

View Source
const IncrementFrontmatterCommandOperation base.CommandOperation = "increment-frontmatter"

IncrementFrontmatterCommandOperation is the Kafka command operation for atomic field increment. Wire string unchanged: "increment-frontmatter".

View Source
const UpdateFrontmatterCommandOperation base.CommandOperation = "update-frontmatter"

UpdateFrontmatterCommandOperation is the Kafka command operation for partial frontmatter update. Wire string unchanged: "update-frontmatter".

Variables

This section is empty.

Functions

This section is empty.

Types

type BodySection

type BodySection struct {
	Heading string `json:"heading"`
	Section string `json:"section"`
}

BodySection describes an idempotent body-section write for UpdateFrontmatterCommand. Heading MUST include the markdown prefix (e.g. "## Failure"). Section MUST include the heading as its first line and a trailing newline.

type CreateCommand

type CreateCommand struct {
	TaskIdentifier lib.TaskIdentifier  `json:"taskIdentifier"`
	Title          string              `json:"title"`
	Frontmatter    lib.TaskFrontmatter `json:"frontmatter"`
	Body           string              `json:"body,omitempty"`
}

CreateCommand is the payload for CreateCommandOperation. JSON tags are byte-identical to the former lib.CreateTaskCommand for wire compatibility.

func (CreateCommand) Validate

func (cmd CreateCommand) Validate(ctx context.Context) error

Validate enforces CreateCommand schema rules before publishing or processing.

type CreateCommandSender

type CreateCommandSender interface {
	SendCommand(ctx context.Context, cmd CreateCommand) error
}

CreateCommandSender sends CreateCommand payloads to Kafka. Calls Validate before publishing — a validation error is returned without touching Kafka.

func NewCreateCommandSender

func NewCreateCommandSender(commandObjectSender cdb.CommandObjectSender) CreateCommandSender

NewCreateCommandSender creates a CreateCommandSender using the given cdb.CommandObjectSender.

type IncrementFrontmatterCommand

type IncrementFrontmatterCommand struct {
	TaskIdentifier lib.TaskIdentifier `json:"taskIdentifier"`
	Field          string             `json:"field"`
	Delta          int                `json:"delta"`
}

IncrementFrontmatterCommand is the payload for IncrementFrontmatterCommandOperation. JSON tags are byte-identical to the former lib.IncrementFrontmatterCommand.

func (IncrementFrontmatterCommand) Validate

Validate enforces IncrementFrontmatterCommand schema rules before publishing. TaskIdentifier and Field must be non-empty. Delta is unconstrained (zero and negative are valid).

type IncrementFrontmatterCommandSender

type IncrementFrontmatterCommandSender interface {
	SendCommand(ctx context.Context, cmd IncrementFrontmatterCommand) error
}

IncrementFrontmatterCommandSender sends IncrementFrontmatterCommand payloads to Kafka. Calls Validate before publishing — a validation error is returned without touching Kafka.

func NewIncrementFrontmatterCommandSender

func NewIncrementFrontmatterCommandSender(
	commandObjectSender cdb.CommandObjectSender,
) IncrementFrontmatterCommandSender

NewIncrementFrontmatterCommandSender creates an IncrementFrontmatterCommandSender.

type UpdateFrontmatterCommand

type UpdateFrontmatterCommand struct {
	TaskIdentifier lib.TaskIdentifier  `json:"taskIdentifier"`
	Updates        lib.TaskFrontmatter `json:"updates"`
	Body           *BodySection        `json:"body,omitempty"`
}

UpdateFrontmatterCommand is the payload for UpdateFrontmatterCommandOperation. JSON tags are byte-identical to the former lib.UpdateFrontmatterCommand.

func (UpdateFrontmatterCommand) Validate

func (cmd UpdateFrontmatterCommand) Validate(ctx context.Context) error

Validate enforces UpdateFrontmatterCommand schema rules before publishing. TaskIdentifier must be non-empty. At least one of Updates (non-empty map) or Body (non-nil) must be set — a no-op command with both absent is a producer bug.

type UpdateFrontmatterCommandSender

type UpdateFrontmatterCommandSender interface {
	SendCommand(ctx context.Context, cmd UpdateFrontmatterCommand) error
}

UpdateFrontmatterCommandSender sends UpdateFrontmatterCommand payloads to Kafka. Calls Validate before publishing — a validation error is returned without touching Kafka.

func NewUpdateFrontmatterCommandSender

func NewUpdateFrontmatterCommandSender(
	commandObjectSender cdb.CommandObjectSender,
) UpdateFrontmatterCommandSender

NewUpdateFrontmatterCommandSender creates an UpdateFrontmatterCommandSender.

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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