tasksave

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package tasksave defines durable, resumable Jira task-save state.

Index

Constants

View Source
const (
	// CurrentVersion is the journal schema version written by this release.
	CurrentVersion = 1
	// RetryWindow is how long a partial save can be retried with its local image data.
	RetryWindow = 24 * time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Draft

type Draft struct {
	Summary          string
	Description      jira.Description
	StoryPoints      *float64
	WriteSummary     bool
	WriteDescription bool
}

Draft is the user's intended Jira task content.

type Journal

type Journal struct {
	Version        int
	ID             string
	Kind           Kind
	TempKey        string
	IssueKey       string
	Issue          jira.Issue
	Draft          Draft
	AssigneeID     string
	SprintID       int
	IssueCreated   bool
	AddedToSprint  bool
	ContentUpdated bool
	CreatedAt      time.Time
	LastAcceptedAt time.Time
}

Journal records every Jira step accepted during one task save.

func NewCreate

func NewCreate(tempKey string, issue jira.Issue, draft Draft, now time.Time) (Journal, error)

NewCreate creates a journal before any Jira write is attempted.

func NewUpdate

func NewUpdate(issue jira.Issue, draft Draft, now time.Time) (Journal, error)

NewUpdate creates a journal before any Jira write is attempted.

func (Journal) Complete

func (j Journal) Complete() bool

Complete reports whether every required Jira write has been accepted.

func (Journal) Expired

func (j Journal) Expired(now time.Time) bool

Expired reports whether Jira accepted no progress recently enough for a direct retry.

func (Journal) Projection

func (j Journal) Projection() jira.Issue

Projection returns the issue content the user intended, including partial saves.

func (Journal) Validate

func (j Journal) Validate() error

Validate checks whether journal metadata can be safely resumed.

type Kind

type Kind string

Kind identifies whether a journal creates a new Jira task or updates one.

const (
	// KindCreate identifies a save that creates a Jira task.
	KindCreate Kind = "create"
	// KindUpdate identifies a save that updates an existing Jira task.
	KindUpdate Kind = "update"
)

Jump to

Keyboard shortcuts

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