drift

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReportSeverityStrings

func ReportSeverityStrings() []string

ReportSeverityStrings returns a slice of all String values of the enum

func ReportStatusStrings

func ReportStatusStrings() []string

ReportStatusStrings returns a slice of all String values of the enum

func ReportTypeStrings

func ReportTypeStrings() []string

ReportTypeStrings returns a slice of all String values of the enum

Types

type Change

type Change struct {
	Kind       string         `json:"kind"`
	Path       string         `json:"path"`
	Before     string         `json:"before"`
	After      string         `json:"after"`
	Severity   ReportSeverity `json:"severity"`
	ReasonCode string         `json:"reason_code"`
}

type Impact

type Impact struct {
	Kind         string         `json:"kind"`
	PipelineSlug string         `json:"pipeline_slug,omitempty"`
	StepSlug     string         `json:"step_slug,omitempty"`
	EdgeSlug     string         `json:"edge_slug,omitempty"`
	Severity     ReportSeverity `json:"severity"`
	Message      string         `json:"message"`
}

func PortImpacts

func PortImpacts(pipeline *pipelinespec.Pipeline, step slug.Slug, severity ReportSeverity) []Impact

PortImpacts follows actual graph edges, including transitive sink consumers.

type Report

type Report struct {
	Type     ReportType     `json:"type"`
	Status   ReportStatus   `json:"status"`
	Severity ReportSeverity `json:"severity"`
	Summary  string         `json:"summary"`
	Changes  []Change       `json:"changes"`
	Impacts  []Impact       `json:"impacts"`
}

func ContractImpact

func ContractImpact(before, after *pipelinespec.Pipeline) *Report

ContractImpact compares a deployed pipeline with a candidate and returns a reportable impact summary. It only reports real semantic changes, leaving unchanged specs without a report.

func PortImpact

func PortImpact(pipeline *pipelinespec.Pipeline, step slug.Slug, port string, before, after *payload.Contract) *Report

PortImpact uses the same compatibility rules as an inline contract edit.

type ReportSeverity

type ReportSeverity int

ReportSeverity identifies the strongest compatibility effect in a report.

const (
	ReportSeverityUnknown  ReportSeverity = iota // unknown
	ReportSeveritySafe                           // safe
	ReportSeverityWarning                        // warning
	ReportSeverityBreaking                       // breaking
)

func ReportSeverityString

func ReportSeverityString(s string) (ReportSeverity, error)

ReportSeverityString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ReportSeverityValues

func ReportSeverityValues() []ReportSeverity

ReportSeverityValues returns all values of the enum

func (ReportSeverity) IsAReportSeverity

func (i ReportSeverity) IsAReportSeverity() bool

IsAReportSeverity returns "true" if the value is listed in the enum definition. "false" otherwise

func (ReportSeverity) MarshalJSON

func (i ReportSeverity) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ReportSeverity

func (ReportSeverity) MarshalText

func (i ReportSeverity) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for ReportSeverity

func (ReportSeverity) String

func (i ReportSeverity) String() string

func (*ReportSeverity) UnmarshalJSON

func (i *ReportSeverity) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReportSeverity

func (*ReportSeverity) UnmarshalText

func (i *ReportSeverity) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for ReportSeverity

type ReportStatus

type ReportStatus int

ReportStatus identifies whether a report is still current.

const (
	ReportStatusUnknown    ReportStatus = iota // unknown
	ReportStatusOpen                           // open
	ReportStatusSuperseded                     // superseded
)

func ReportStatusString

func ReportStatusString(s string) (ReportStatus, error)

ReportStatusString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ReportStatusValues

func ReportStatusValues() []ReportStatus

ReportStatusValues returns all values of the enum

func (ReportStatus) IsAReportStatus

func (i ReportStatus) IsAReportStatus() bool

IsAReportStatus returns "true" if the value is listed in the enum definition. "false" otherwise

func (ReportStatus) MarshalJSON

func (i ReportStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ReportStatus

func (ReportStatus) MarshalText

func (i ReportStatus) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for ReportStatus

func (ReportStatus) String

func (i ReportStatus) String() string

func (*ReportStatus) UnmarshalJSON

func (i *ReportStatus) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReportStatus

func (*ReportStatus) UnmarshalText

func (i *ReportStatus) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for ReportStatus

type ReportType

type ReportType int

ReportType identifies the producer of a drift or impact report.

const (
	ReportTypeUnknown        ReportType = iota // unknown
	ReportTypeContractImpact                   // contract_impact
	ReportTypeSourceSchema                     // source_schema
)

func ReportTypeString

func ReportTypeString(s string) (ReportType, error)

ReportTypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func ReportTypeValues

func ReportTypeValues() []ReportType

ReportTypeValues returns all values of the enum

func (ReportType) IsAReportType

func (i ReportType) IsAReportType() bool

IsAReportType returns "true" if the value is listed in the enum definition. "false" otherwise

func (ReportType) MarshalJSON

func (i ReportType) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for ReportType

func (ReportType) MarshalText

func (i ReportType) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface for ReportType

func (ReportType) String

func (i ReportType) String() string

func (*ReportType) UnmarshalJSON

func (i *ReportType) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface for ReportType

func (*ReportType) UnmarshalText

func (i *ReportType) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface for ReportType

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL