Documentation
¶
Index ¶
Constants ¶
const CreateCommandOperation base.CommandOperation = "create-task"
CreateCommandOperation is the Kafka command operation for creating a new vault task. Wire string unchanged: "create-task".
const IncrementFrontmatterCommandOperation base.CommandOperation = "increment-frontmatter"
IncrementFrontmatterCommandOperation is the Kafka command operation for atomic field increment. Wire string unchanged: "increment-frontmatter".
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 ¶
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.
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.
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.