Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rule ¶
type Rule struct { Path string `json:"Path"` Operation string `json:"Operation"` ComponentName string `json:"ComponentName"` ComponentType string `json:"ComponentType"` Required bool `json:"Required"` Notification string `json:"Notification"` URL string `json:"Docs"` }
Rule holds all needed attribute from a parsed rule
func (Rule) DoesRuleApplyInContext ¶
DoesRuleApplyInContext
@brief:
DoesRuleApplyInContext checks if the rule applies to the user's context
@params:
filepath - string - the path to the file resourceName - string - the resource the rule applies to resourceType - string - the type of the resource the rule applies to
@returns:
bool - true if applies. else false error - if exists, otherwise false
func (Rule) IsNew ¶
IsNew
@brief:
IsNew checks if the Rule in context represents a new resource / component
func (Rule) IsParameterChange ¶
IsParameterChange
@brief:
IsParameterChange validates that a rule does not concern to a new parameter (computed, deprecated etc.)
@returns:
bool - true if parameter. else false
func (Rule) PrettyPrint ¶
func (r Rule) PrettyPrint()
PrettyPrint
@brief:
PrettyPrint prints the Rule object
func (Rule) PrettyPrintWhatsNew ¶
func (r Rule) PrettyPrintWhatsNew()
PrettyPrintWhatsNew
@brief:
PrettyPrintWhatsNew prints the Rule object if new
type RuleSet ¶
type RuleSet struct { ResourceName string `json:"ResourceName"` Appearances []string `json:"Appearances"` Rules []Rule `json:"Changes"` }
RuleSet is holding the ruleset as a gabs.Container object alongside relevant metadata
func (RuleSet) GetNewComponents ¶
GetNewComponents
@brief:
GetNewComponents finds all the new components in the next version
@returns:
[]string - a slice of notifications of what's new
func (RuleSet) PrettyPrintWhatsNew ¶
func (r RuleSet) PrettyPrintWhatsNew()
PrettyPrintWhatsNew
@brief:
PrettyPrintWhatsNew prints the RuleSet new objects
type Rulebook ¶
Rulebook is holding the rulebook as bytes alongside relevant metadata
func GetRules ¶
GetRules
@brief:
GetRules retrieves a rulebook from the API
@params:
provider - string - the provider name sourceVersion - string - the source version
@returns:
Rulebook - the initializes Rulebook error - if exists, else nil
func (Rulebook) GetAllRuleSets ¶
GetAllRuleSets
@brief:
GetAllRuleSets returns all RuleSets in a rulebook
@returns:
map[string]interface{} - the rules as a map of interfaces error - if exists, else nil
func (Rulebook) GetRuleSetByResource ¶
func (r Rulebook) GetRuleSetByResource(resourceName, resourceType string) (rule *gabs.Container, err error)
GetRuleSetByResource
@brief:
GetRuleSetByResource retrieves a rule from the rulebook in context by its name
@params:
resourceName - string - the resource name to fetch the rule for
@returns:
rule - *gabs.Container - the rule as a gabs json object err - error - if exists, else nil
func (Rulebook) GetTargetVersion ¶
Click to show internal directories.
Click to hide internal directories.