Documentation
¶
Overview ¶
Package values contains domain value objects that encapsulate primitive types with validation and such.
Index ¶
- Variables
- type ControlID
- type Digest
- type ExecutionID
- type PluginMetadata
- type PluginName
- type PluginReference
- type Severity
- func (s Severity) Equals(other Severity) bool
- func (s Severity) IsHigherOrEqual(other Severity) bool
- func (s Severity) IsHigherThan(other Severity) bool
- func (s Severity) Level() int
- func (s Severity) MarshalJSON() ([]byte, error)
- func (s Severity) String() string
- func (s *Severity) UnmarshalJSON(data []byte) error
- type SeverityLevel
- type Status
Constants ¶
This section is empty.
Variables ¶
var ( SevUnknown = Severity{SeverityUnknown} SevLow = Severity{SeverityLow} SevMedium = Severity{SeverityMedium} SevHigh = Severity{SeverityHigh} SevCritical = Severity{SeverityCritical} )
Predefined severity values
Functions ¶
This section is empty.
Types ¶
type ControlID ¶
type ControlID struct {
// contains filtered or unexported fields
}
ControlID uniquely identifies a control within a profile. Enforces non-empty, trimmed identifiers.
func MustNewControlID ¶
MustNewControlID creates a ControlID or panics (for tests/constants)
func NewControlID ¶
NewControlID creates a new ControlID with validation
func (ControlID) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*ControlID) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
Digest represents a content hash with algorithm.
func ComputeDigestSHA256 ¶
ComputeDigestSHA256 computes SHA-256 digest of reader contents.
func ParseDigest ¶
ParseDigest parses a digest string (e.g., "sha256:abc123...").
type ExecutionID ¶
type ExecutionID struct {
// contains filtered or unexported fields
}
ExecutionID uniquely identifies a profile execution. This is critical for persistence, distributed execution, and result tracking.
func FromUUID ¶
func FromUUID(id uuid.UUID) ExecutionID
FromUUID creates an ExecutionID from a uuid.UUID
func MustParseExecutionID ¶
func MustParseExecutionID(s string) ExecutionID
MustParseExecutionID parses a string or panics (for tests only)
func NewExecutionID ¶
func NewExecutionID() ExecutionID
NewExecutionID creates a new random execution ID
func ParseExecutionID ¶
func ParseExecutionID(s string) (ExecutionID, error)
ParseExecutionID parses a string into an ExecutionID
func (ExecutionID) Equals ¶
func (e ExecutionID) Equals(other ExecutionID) bool
Equals checks if two ExecutionIDs are equal
func (ExecutionID) IsZero ¶
func (e ExecutionID) IsZero() bool
IsZero returns true if this is the zero value
func (ExecutionID) MarshalJSON ¶
func (e ExecutionID) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler
func (ExecutionID) String ¶
func (e ExecutionID) String() string
String returns the string representation
func (ExecutionID) UUID ¶
func (e ExecutionID) UUID() uuid.UUID
UUID returns the underlying uuid.UUID
func (*ExecutionID) UnmarshalJSON ¶
func (e *ExecutionID) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type PluginMetadata ¶
type PluginMetadata struct {
// contains filtered or unexported fields
}
PluginMetadata contains descriptive information about a plugin.
func NewPluginMetadata ¶
func NewPluginMetadata(name, version, description string, capabilities []string) PluginMetadata
NewPluginMetadata creates plugin metadata.
func (PluginMetadata) Capabilities ¶
func (m PluginMetadata) Capabilities() []string
Capabilities returns required capabilities.
func (PluginMetadata) Description ¶
func (m PluginMetadata) Description() string
Description returns human-readable description.
func (PluginMetadata) Version ¶
func (m PluginMetadata) Version() string
Version returns the semantic version.
type PluginName ¶
type PluginName struct {
// contains filtered or unexported fields
}
PluginName represents a validated plugin identifier. Enforces non-empty, trimmed plugin names.
func MustNewPluginName ¶
func MustNewPluginName(name string) PluginName
MustNewPluginName creates a PluginName or panics
func NewPluginName ¶
func NewPluginName(name string) (PluginName, error)
NewPluginName creates a PluginName with strict validation. A valid plugin name must: - Be non-empty - contain only alphanumeric characters, underscores, and hyphens - NOT contain paths, dots, or special characters - Be at most 64 characters long
func (PluginName) Equals ¶
func (p PluginName) Equals(other PluginName) bool
Equals checks if two plugin names are equal
func (PluginName) IsEmpty ¶
func (p PluginName) IsEmpty() bool
IsEmpty returns true if this is the zero value
func (PluginName) MarshalJSON ¶
func (p PluginName) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler. Uses json.Marshal for proper character escaping.
func (PluginName) String ¶
func (p PluginName) String() string
String returns the string representation
func (*PluginName) UnmarshalJSON ¶
func (p *PluginName) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler
type PluginReference ¶
type PluginReference struct {
// contains filtered or unexported fields
}
PluginReference uniquely identifies a plugin version. Format: registry.io/org/repo/name:version or name (for embedded)
func NewPluginReference ¶
func NewPluginReference(registry, org, repo, name, version string) PluginReference
NewPluginReference creates a reference from components.
func ParsePluginReference ¶
func ParsePluginReference(ref string) (PluginReference, error)
ParsePluginReference parses OCI reference string. Examples:
- file (embedded)
- ghcr.io/whiskeyjimbo/reglet-plugins/file:1.0.2
func (PluginReference) Equals ¶
func (r PluginReference) Equals(other PluginReference) bool
Equals checks equality with another reference.
func (PluginReference) IsEmbedded ¶
func (r PluginReference) IsEmbedded() bool
IsEmbedded returns true if this is a built-in plugin.
func (PluginReference) Registry ¶
func (r PluginReference) Registry() string
Registry returns the registry hostname.
func (PluginReference) String ¶
func (r PluginReference) String() string
String returns the canonical OCI reference string.
func (PluginReference) Version ¶
func (r PluginReference) Version() string
Version returns the version tag.
type Severity ¶
type Severity struct {
// contains filtered or unexported fields
}
Severity represents the severity level of a control. Enforces valid severity values and provides ordering.
func MustNewSeverity ¶
MustNewSeverity creates a Severity or panics
func NewSeverity ¶
NewSeverity creates a Severity from string
func (Severity) IsHigherOrEqual ¶
IsHigherOrEqual returns true if this severity is higher or equal to the other
func (Severity) IsHigherThan ¶
IsHigherThan returns true if this severity is higher than the other
func (Severity) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*Severity) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler
type SeverityLevel ¶
type SeverityLevel int
SeverityLevel is the internal representation
const ( // SeverityUnknown = Unknown SeverityUnknown SeverityLevel = 0 // SeverityLow = Low SeverityLow SeverityLevel = 1 // SeverityMedium = Medium SeverityMedium SeverityLevel = 2 // SeverityHigh = High SeverityHigh SeverityLevel = 3 // SeverityCritical = Critical SeverityCritical SeverityLevel = 4 )
type Status ¶
type Status string
Status represents the status of a control or observation.
const ( // StatusPass indicates the check passed StatusPass Status = "pass" // StatusFail indicates the check failed (but ran successfully) StatusFail Status = "fail" // StatusError indicates the check encountered an error StatusError Status = "error" // StatusSkipped indicates the check was skipped (dependency failure or filtered) StatusSkipped Status = "skipped" )
func (Status) Precedence ¶
Precedence returns the numeric precedence of this status. Higher values indicate higher priority in aggregation. Used by status aggregator to determine control status.
Precedence: Fail (3) > Error (2) > Skipped (1) > Pass (0)