Internal

internal/app/packetrepair

Package packetrepair writes operator-facing provider packet repair artifacts.

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

Package packetrepair writes operator-facing provider packet repair artifacts.

Variables

Source: internal/app/packetrepair/packetrepair.go:18

var (
	ErrIdentityMismatch      = errors.New("provider packet repair artifact identity mismatch")
	ErrMissingRepairedPacket = errors.New("provider packet repair artifact is missing repaired_packet")
)

Functions

func Blockers(action gate.RepairAction) []string

Source: internal/app/packetrepair/action.go:44

func Decode(data []byte) (Artifact, error)

Source: internal/app/packetrepair/packetrepair.go:91

func Encode(artifact Artifact) ([]byte, error)

Source: internal/app/packetrepair/packetrepair.go:96

func FollowUp(action gate.RepairAction) string

Source: internal/app/packetrepair/action.go:40

func HardenAction(taskID string, artifactPath string) gate.RepairAction

Source: internal/app/packetrepair/action.go:16

func Load(path string, identity Identity) ([]byte, error)

Source: internal/app/packetrepair/packetrepair.go:58

func LooksLikeArtifactPath(gateName string, path string) bool

Source: internal/app/packetrepair/action.go:30

func ReviewAction(taskID string, artifactPath string) gate.RepairAction

Source: internal/app/packetrepair/action.go:12

func RootFromSpecPath(path string) string

Source: internal/app/packetrepair/packetrepair.go:165

func SourceFromError(err error) (providerpacket.Source, bool)

Source: internal/app/packetrepair/packetrepair.go:49

func WriteArtifact(input ArtifactInput) (string, bool)

Source: internal/app/packetrepair/packetrepair.go:107

Types

type Artifact

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

type Artifact struct {
	TaskID         string          `json:"task_id"`
	Gate           string          `json:"gate"`
	AttemptID      string          `json:"attempt_id,omitempty"`
	RoundID        string          `json:"round_id,omitempty"`
	Error          string          `json:"error,omitempty"`
	RejectedText   string          `json:"rejected_text,omitempty"`
	DiagnosticPath string          `json:"diagnostic_path,omitempty"`
	AcceptCommand  string          `json:"accept_command"`
	RepairedPacket json.RawMessage `json:"repaired_packet"`
}
Fields
  • TaskID string `json:"task_id"`
  • Gate string `json:"gate"`
  • AttemptID string `json:"attempt_id,omitempty"`
  • RoundID string `json:"round_id,omitempty"`
  • Error string `json:"error,omitempty"`
  • RejectedText string `json:"rejected_text,omitempty"`
  • DiagnosticPath string `json:"diagnostic_path,omitempty"`
  • AcceptCommand string `json:"accept_command"`
  • RepairedPacket json.RawMessage `json:"repaired_packet"`

type ArtifactInput

Source: internal/app/packetrepair/packetrepair.go:30

type ArtifactInput struct {
	Root, TaskID, Name, Gate, AttemptID, RoundID string
	Source                                       providerpacket.Source
	Err                                          error
	AcceptCommand                                func(path string) string
}
Fields
  • Root string
  • TaskID string
  • Name string
  • Gate string
  • AttemptID string
  • RoundID string
  • Source providerpacket.Source
  • Err error
  • AcceptCommand func(path string) string

type Identity

Source: internal/app/packetrepair/packetrepair.go:26

type Identity struct {
	TaskID, Gate, AttemptID, RoundID string
}
Fields
  • TaskID string
  • Gate string
  • AttemptID string
  • RoundID string