Internal

internal/app/plan

Package plan creates draft specs from operator input.

import "github.com/nilstate/scafld/v2/internal/app/plan"

Package plan creates draft specs from operator input.

Variables

ErrMissingSpecStore is returned when planning has no spec store.

Source: internal/app/plan/plan.go:14

var ErrMissingSpecStore = errors.New("missing spec store")

Functions

func Run(ctx context.Context, store SpecStore, clock Clock, input Input) (Output, error)

Source: internal/app/plan/plan.go:44

Run creates a draft spec from input.

Types

type Clock

Source: internal/app/plan/plan.go:22

Clock supplies planning timestamps.

type Clock interface {
	Now() time.Time
}
Methods
  • Now func() time.Time

type Input

Source: internal/app/plan/plan.go:27

Input describes the operator-provided draft spec fields.

type Input struct {
	TaskID  string
	Title   string
	Summary string
	Command string
	Size    string
	Risk    string
}
Fields
  • TaskID string
  • Title string
  • Summary string
  • Command string
  • Size string
  • Risk string

type Output

Source: internal/app/plan/plan.go:37

Output describes the created draft spec.

type Output struct {
	TaskID string      `json:"task_id"`
	Path   string      `json:"path"`
	Status spec.Status `json:"status"`
}
Fields
  • TaskID string `json:"task_id"`
  • Path string `json:"path"`
  • Status spec.Status `json:"status"`

type SpecStore

Source: internal/app/plan/plan.go:17

SpecStore is the spec creation port used by planning.

type SpecStore interface {
	CreateDraft(context.Context, spec.Model) (string, error)
}
Methods
  • CreateDraft func(context.Context, spec.Model) (string, error)