Documentation
¶
Index ¶
- func BoolDerefToPointer(ptr *bool, def bool) *bool
- func DefaultToStringSlice(value []string) []string
- func DiffPermissions(a map[string]string, b map[string]string) (map[string]string, map[string]string, map[string]string)
- func DiffProtectedBranches(a, b map[string]v1alpha1.BranchProtectionRule) (map[string]v1alpha1.BranchProtectionRule, ...)
- func DiffRepoWebhooks(a, b map[string]v1alpha1.RepositoryWebhook) (map[string]v1alpha1.RepositoryWebhook, map[string]v1alpha1.RepositoryWebhook, ...)
- func DiffRepositoryRulesets(a, b map[string]v1alpha1.RepositoryRuleset) (map[string]v1alpha1.RepositoryRuleset, map[string]v1alpha1.RepositoryRuleset, ...)
- func EqualUnordered(a, b []string) bool
- func GenerateSHA1Hash(s string) string
- func IntDerefToPointer(ptr *int, def int) *int
- func MergeMaps(m1 map[string]string, m2 map[string]string) map[string]string
- func SortAndReturn(s []string) []string
- func SortAndReturnPointer(s []string) *[]string
- func SortByKey(m map[string]string) map[string]string
- func SortRequiredStatusChecks(checks []*v1alpha1.RequiredStatusCheck)
- func SortRulesBypassActors(actors []*v1alpha1.RulesetByPassActors)
- func SortRulesCodeScanningTools(tools []*v1alpha1.RulesCodeScanningTool)
- func SortRulesRequiredStatusChecks(checks []*v1alpha1.RulesRequiredStatusChecksParameters)
- func StringDerefToPointer(ptr *string, def string) *string
- func ToLowerSlice(input []string) []string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BoolDerefToPointer ¶
BoolDerefToPointer dereferences the pointer to bool 'ptr', uses 'def' as a default if 'ptr' is nil, and returns a new pointer to the resulting bool.
func DefaultToStringSlice ¶
DefaultToStringSlice is a helper function that checks if the provided slice is nil and returns an empty string slice in that case. If the slice is not nil, the same slice is returned. The purpose of this function is to avoid nil dereference issues in slices and provide a safe way to default to an empty slice.
func DiffPermissions ¶
func DiffProtectedBranches ¶
func DiffProtectedBranches(a, b map[string]v1alpha1.BranchProtectionRule) ( map[string]v1alpha1.BranchProtectionRule, map[string]v1alpha1.BranchProtectionRule, map[string]v1alpha1.BranchProtectionRule, )
DiffProtectedBranches compares two maps of BranchProtectionRule, map 'a’ and map 'b’. It returns three maps: inANotInB: entities (keys) that are present in 'a' but not in 'b' mapped to their values in 'a' inBNotInA: entities (keys) that are present in 'b' but not in 'a' mapped to their values in 'b' diffs: entities (keys) that are present in both 'a' and 'b' but have different values, mapped to their values in 'b'
func DiffRepoWebhooks ¶
func DiffRepoWebhooks(a, b map[string]v1alpha1.RepositoryWebhook) (map[string]v1alpha1.RepositoryWebhook, map[string]v1alpha1.RepositoryWebhook, map[string]v1alpha1.RepositoryWebhook)
func DiffRepositoryRulesets ¶
func DiffRepositoryRulesets(a, b map[string]v1alpha1.RepositoryRuleset) ( map[string]v1alpha1.RepositoryRuleset, map[string]v1alpha1.RepositoryRuleset, map[string]v1alpha1.RepositoryRuleset)
DiffRepositoryRulesets compares two maps of RepositoryRuleset, 'a' and 'b'. It returns three maps: inANotInB: entities (keys) that are present in 'a' but not in 'b' mapped to their values in 'a' inBNotInA: entities (keys) that are present in 'b' but not in 'a' mapped to their values in 'b' diffs: entities (keys) that are present in both 'a' and 'b' but have different values, mapped to their values in 'b'
func EqualUnordered ¶
EqualUnordered reports whether a and b hold the same strings, ignoring order. nil and empty are equal.
func GenerateSHA1Hash ¶
GenerateSHA1Hash hashes a string to SHA-1
func IntDerefToPointer ¶
IntDerefToPointer is a helper function that dereferences a pointer to an int 'ptr', and returns a new pointer to the resulting int. If 'ptr' is nil, it uses 'def' as a default value.
func SortAndReturn ¶
SortAndReturn sorts a slice of strings in lexicographical order and returns the sorted slice.
func SortAndReturnPointer ¶
SortAndReturnPointer sorts a slice of strings and returns a pointer to that sorted slice.
func SortRequiredStatusChecks ¶
func SortRequiredStatusChecks(checks []*v1alpha1.RequiredStatusCheck)
SortRequiredStatusChecks sorts a slice of RequiredStatusCheck pointers in-place by the Context field in ascending order.
func SortRulesBypassActors ¶
func SortRulesBypassActors(actors []*v1alpha1.RulesetByPassActors)
SortRulesBypassActors sorts a slice of RulesetByPassActors pointers in-place by ActorType, then ActorID with nil first, then BypassMode.
func SortRulesCodeScanningTools ¶
func SortRulesCodeScanningTools(tools []*v1alpha1.RulesCodeScanningTool)
SortRulesCodeScanningTools sorts a slice of RulesCodeScanningTool pointers in-place by Tool, then AlertsThreshold, then SecurityAlertsThreshold.
func SortRulesRequiredStatusChecks ¶
func SortRulesRequiredStatusChecks(checks []*v1alpha1.RulesRequiredStatusChecksParameters)
SortRulesRequiredStatusChecks sorts a slice of RequiredStatusCheck pointers in-place by the Context field in ascending order, then by IntegrationID with nil first.
func StringDerefToPointer ¶
StringDerefToPointer is a helper function that dereferences a pointer to a string 'ptr', and returns a new pointer to the resulting string. If 'ptr' is nil, it uses 'def' as a default value.
func ToLowerSlice ¶
ToLowerSlice converts all the strings in the slice to lowercase.
Types ¶
This section is empty.