Internal

internal/app/validate

Package validate checks specs without mutating workspace state.

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

Package validate checks specs without mutating workspace state.

Functions

func Run(ctx context.Context, store SpecStore, taskID string) (Output, error)

Source: internal/app/validate/validate.go:24

Run validates a spec without mutating workspace state.

Types

type Output

Source: internal/app/validate/validate.go:16

Output reports spec validation status.

type Output struct {
	TaskID string   `json:"task_id"`
	Path   string   `json:"path"`
	Valid  bool     `json:"valid"`
	Errors []string `json:"errors"`
}
Fields
  • TaskID string `json:"task_id"`
  • Path string `json:"path"`
  • Valid bool `json:"valid"`
  • Errors []string `json:"errors"`

type SpecStore

Source: internal/app/validate/validate.go:11

SpecStore is the spec loading port used by validation.

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