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 ¶
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 ¶
func ActionOptFromDB(dbState db.NullActionType) ActionOpt
ActionOptFromDB converts the db representation of action type to ActionOpt
func ActionOptOrDefault ¶
ActionOptOrDefault returns defaultVal if the ActionOpt is ActionOptUnknown, or returns actionOpt otherwise
type ProfileAggregate ¶
type ProfileAggregate struct { ID uuid.UUID Name string ActionConfig ActionConfiguration Rules []RuleInstance Selectors []ProfileSelector }
ProfileAggregate represents a profile along with rule instances
type ProfileSelector ¶
ProfileSelector is a domain-level model of a profile selector
func SelectorSliceFromDB ¶
func SelectorSliceFromDB(dbSelectors []db.ProfileSelector) []ProfileSelector
SelectorSliceFromDB converts a slice of db.ProfileSelector to a slice of ProfileSelector
type RuleInstance ¶
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 ¶
func RuleFromDB(rule db.RuleInstance) (RuleInstance, error)
RuleFromDB converts a DB schema rule instance to the domain model
func RuleFromPB ¶
func RuleFromPB( ruleTypeID uuid.UUID, pbRule *minderv1.Profile_Rule, ) RuleInstance
RuleFromPB converts a protobuf rule instance to the domain model