Documentation ¶
Index ¶
- func CleanConditions(conditions *data.Conditions) *data.Conditions
- func CleanSlice(slice []string) []string
- func Contains(slice []string, item string) bool
- func CreateRepoRulesetsData(owner string, fileData [][]string) []data.RepoRuleset
- func GetAuthToken(token, hostname string) string
- func GetValidFields(ruleType string) map[string]map[string]struct{}
- func InitializeClients(hostname, authToken string) (api.RESTClient, api.GQLClient, error)
- func MapToParameters(paramsMap map[string]interface{}, ruleType string) *data.Parameters
- func ParametersToMap(params data.Parameters, ruleType string) map[string]string
- func ProcessActors(actors []data.BypassActor) []string
- func ProcessProperties(properties []data.PropertyPattern) []string
- func ProcessRules(rules []data.Rules) map[string]string
- func ShouldRemoveProperty(propName *data.PropertyPatterns) bool
- func ShouldRemoveRefName(refName *data.RefPatterns) bool
- func ShouldRemoveRepositoryName(repoName *data.NamePatterns) bool
- func UpdateTag(field reflect.StructField, key, value string) reflect.StructField
- type APIGetter
- func (g *APIGetter) CreateOrgLevelRuleset(owner string, data io.Reader) error
- func (g *APIGetter) CreateRepoLevelRuleset(ownerRepo string, data io.Reader) error
- func (g *APIGetter) GetOrgLevelRuleset(owner string, rulesetId int) ([]byte, error)
- func (g *APIGetter) GetOrgRulesetsList(owner string, endCursor *string) (*data.OrgRulesetsQuery, error)
- func (g *APIGetter) GetRepo(owner string, name string) (*data.RepoSingleQuery, error)
- func (g *APIGetter) GetRepoLevelRuleset(owner string, repo string, rulesetId int) ([]byte, error)
- func (g *APIGetter) GetRepoRulesetsList(owner string, repo string, endCursor *string) (*data.RepoRulesetsQuery, error)
- func (g *APIGetter) GetReposList(owner string, endCursor *string) (*data.ReposQuery, error)
- type Getter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanConditions ¶
func CleanConditions(conditions *data.Conditions) *data.Conditions
func CleanSlice ¶
func CreateRepoRulesetsData ¶
func CreateRepoRulesetsData(owner string, fileData [][]string) []data.RepoRuleset
func GetAuthToken ¶
func GetValidFields ¶
getValidFields returns the valid fields for a given rule type.
func InitializeClients ¶
func MapToParameters ¶
func MapToParameters(paramsMap map[string]interface{}, ruleType string) *data.Parameters
func ParametersToMap ¶
func ParametersToMap(params data.Parameters, ruleType string) map[string]string
func ProcessActors ¶
func ProcessActors(actors []data.BypassActor) []string
func ProcessProperties ¶
func ProcessProperties(properties []data.PropertyPattern) []string
func ShouldRemoveProperty ¶
func ShouldRemoveProperty(propName *data.PropertyPatterns) bool
func ShouldRemoveRefName ¶
func ShouldRemoveRefName(refName *data.RefPatterns) bool
func ShouldRemoveRepositoryName ¶
func ShouldRemoveRepositoryName(repoName *data.NamePatterns) bool
func UpdateTag ¶
func UpdateTag(field reflect.StructField, key, value string) reflect.StructField
Types ¶
type APIGetter ¶
type APIGetter struct {
// contains filtered or unexported fields
}
func NewAPIGetter ¶
func NewAPIGetter(gqlClient api.GQLClient, restClient api.RESTClient) *APIGetter
func (*APIGetter) CreateOrgLevelRuleset ¶
func (*APIGetter) CreateRepoLevelRuleset ¶
func (*APIGetter) GetOrgLevelRuleset ¶
func (*APIGetter) GetOrgRulesetsList ¶
func (*APIGetter) GetRepoLevelRuleset ¶
func (*APIGetter) GetRepoRulesetsList ¶
func (*APIGetter) GetReposList ¶
type Getter ¶
type Getter interface { GetRepo(owner string, name string) ([]data.RepoSingleQuery, error) GetReposList(owner string, endCursor *string) ([]data.ReposQuery, error) GetOrgRulesetsList(owner string, endCursor *string) (*data.OrgRulesetsQuery, error) GetOrgLevelRuleset(owner string, rulesetId int) ([]byte, error) GetRepoRulesetsList(owner string, endCursor *string) (*data.RepoRulesetsQuery, error) GetRepoLevelRuleset(owner string, repo string, rulesetId int) ([]byte, error) CreateOrgLevelRuleset(owner string, data io.Reader) error }
Click to show internal directories.
Click to hide internal directories.