Documentation
¶
Overview ¶
Package models contains domain models for profiles
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionConfiguration ¶ added in v0.0.57
ActionConfiguration stores the configuration state for a profile
type ActionOpt ¶
type ActionOpt int
ActionOpt is the type that defines what action to take when remediating
const ( // ActionOptOn means perform the remediation ActionOptOn ActionOpt = iota // ActionOptOff means do not perform the remediation ActionOptOff // ActionOptDryRun means perform a dry run of the remediation ActionOptDryRun // ActionOptUnknown means the action is unknown. This is a sentinel value. ActionOptUnknown )
func ActionOptFromDB ¶ added in v0.0.57
func ActionOptFromDB(dbState db.NullActionType) ActionOpt
ActionOptFromDB converts the db representation of action type to ActionOpt
func ActionOptOrDefault ¶ added in v0.0.57
ActionOptOrDefault returns defaultVal if the ActionOpt is ActionOptUnknown, or returns actionOpt otherwise
type ProfileAggregate ¶ added in v0.0.57
type ProfileAggregate struct {
ID uuid.UUID
Name string
ActionConfig ActionConfiguration
Rules []RuleInstance
Selectors []ProfileSelector
}
ProfileAggregate represents a profile along with rule instances
type ProfileSelector ¶ added in v0.0.57
ProfileSelector is a domain-level model of a profile selector
func SelectorSliceFromDB ¶ added in v0.0.57
func SelectorSliceFromDB(dbSelectors []db.ProfileSelector) []ProfileSelector
SelectorSliceFromDB converts a slice of db.ProfileSelector to a slice of ProfileSelector
type RuleInstance ¶ added in v0.0.57
type RuleInstance struct {
ID uuid.UUID
Name string
Def map[string]any
Params map[string]any
RuleTypeID uuid.UUID
}
RuleInstance is a domain-level model of a rule instance
func RuleFromDB ¶ added in v0.0.57
func RuleFromDB(rule db.RuleInstance) (RuleInstance, error)
RuleFromDB converts a DB schema rule instance to the domain model
func RuleFromPB ¶ added in v0.0.57
func RuleFromPB( ruleTypeID uuid.UUID, pbRule *minderv1.Profile_Rule, ) RuleInstance
RuleFromPB converts a protobuf rule instance to the domain model