shared

package
v2.39.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityName

func EntityName(orgOption string, repoI ghrepo.Interface) string

func NoRulesetsFoundError

func NoRulesetsFoundError(orgOption string, repoI ghrepo.Interface, includeParents bool) error

func ParseRulesForDisplay

func ParseRulesForDisplay(rules []RulesetRule) string

func RulesetSource

func RulesetSource(rs RulesetGraphQL) string

Returns the source of the ruleset in the format "owner/name (repo)" or "owner (org)"

Types

type RulesetGraphQL

type RulesetGraphQL struct {
	DatabaseId  int
	Name        string
	Target      string
	Enforcement string
	Source      struct {
		TypeName string `json:"__typename"`
		Owner    string
	}
	Rules struct {
		TotalCount int
	}
}

type RulesetList

type RulesetList struct {
	TotalCount int
	Rulesets   []RulesetGraphQL
}

func ListOrgRulesets

func ListOrgRulesets(httpClient *http.Client, orgLogin string, limit int, host string, includeParents bool) (*RulesetList, error)

func ListRepoRulesets

func ListRepoRulesets(httpClient *http.Client, repo ghrepo.Interface, limit int, includeParents bool) (*RulesetList, error)

type RulesetREST

type RulesetREST struct {
	Id                   int
	Name                 string
	Target               string
	Enforcement          string
	CurrentUserCanBypass string `json:"current_user_can_bypass"`
	BypassActors         []struct {
		ActorId    int    `json:"actor_id"`
		ActorType  string `json:"actor_type"`
		BypassMode string `json:"bypass_mode"`
	} `json:"bypass_actors"`
	Conditions map[string]map[string]interface{}
	SourceType string `json:"source_type"`
	Source     string
	Rules      []RulesetRule
	Links      struct {
		Html struct {
			Href string
		}
	} `json:"_links"`
}

type RulesetResponse

type RulesetResponse struct {
	Level struct {
		Rulesets struct {
			TotalCount int
			Nodes      []RulesetGraphQL
			PageInfo   struct {
				HasNextPage bool
				EndCursor   string
			}
		}
	}
}

type RulesetRule

type RulesetRule struct {
	Type              string
	Parameters        map[string]interface{}
	RulesetSourceType string `json:"ruleset_source_type"`
	RulesetSource     string `json:"ruleset_source"`
	RulesetId         int    `json:"ruleset_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL