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
func Decode(data []byte) (Artifact, error)
func Encode(artifact Artifact) ([]byte, error)
func FollowUp(action gate.RepairAction) string
func HardenAction(taskID string, artifactPath string) gate.RepairAction
func Load(path string, identity Identity) ([]byte, error)
func LooksLikeArtifactPath(gateName string, path string) bool
func ReviewAction(taskID string, artifactPath string) gate.RepairAction
func RootFromSpecPath(path string) string
func SourceFromError(err error) (providerpacket.Source, bool)
func WriteArtifact(input ArtifactInput) (string, bool)
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 stringTaskID stringName stringGate stringAttemptID stringRoundID stringSource providerpacket.SourceErr errorAcceptCommand func(path string) string
type Identity
Source: internal/app/packetrepair/packetrepair.go:26
type Identity struct {
TaskID, Gate, AttemptID, RoundID string
}Fields
TaskID stringGate stringAttemptID stringRoundID string
