Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrReport = errors.New("preflight.report.invalid")
ErrReport indicates the report could not be built.
View Source
var ErrServiceInfo = errors.New("preflight.service_info.invalid")
ErrServiceInfo indicates the service metadata is invalid.
Functions ¶
func BuildReport ¶
func BuildReport(ctx context.Context, schemaVersion string, serviceInfo ServiceInfo, reporter ConfigReporter, checkers []DependencyChecker, mode RedactionMode) ([]byte, error)
BuildReport assembles a preflight report.
func HashSHA256Hex ¶
HashSHA256Hex returns the hex-encoded SHA-256 hash of the payload.
Types ¶
type ConfigReporter ¶
type ConfigReporter interface {
Build(mode RedactionMode) (json.RawMessage, error)
}
ConfigReporter builds the effective config payload.
type DependencyChecker ¶
type DependencyChecker interface {
Check(ctx context.Context) (DependencyStatus, error)
}
DependencyChecker validates external dependencies.
type DependencyStatus ¶
type DependencyStatus struct {
Name string `json:"name"`
Type string `json:"type"`
Ready bool `json:"ready"`
Details map[string]string `json:"details,omitempty"`
}
DependencyStatus describes one dependency check.
type RedactionMode ¶
type RedactionMode int
RedactionMode controls how sensitive fields are reported.
const ( RedactionModeRedacted RedactionMode = iota + 1 RedactionModeFull )
type ServiceInfo ¶
type ServiceInfo interface {
Name() string
Version() string
Commit() string
BuildTime() string
ConfigSchemaVersion() string
EndpointContractVersion() string
// contains filtered or unexported methods
}
ServiceInfo captures build and schema metadata.
func NewServiceInfo ¶
func NewServiceInfo(name string, version string, commit string, buildTime string, configSchemaVersion string, endpointContractVersion string) (ServiceInfo, error)
NewServiceInfo constructs ServiceInfo with required fields.
Click to show internal directories.
Click to hide internal directories.