{"modulePath":"github.com/wloophq/wloop","version":"v0.7.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package scope\n\nPackage scope turns the configured sources into the people, teams and repositories the inventory follows, and the searches that find them.\n\n## Constants\n\n```go\nconst MaxQueryLen = 250\n```\n\n## Types\n\n```go\ntype Config struct {\n\tPeople []string `json:\"people\"`\n\tTeams  []string `json:\"teams\"`\n\tRepos  []string `json:\"repos\"`\n\tWatch  []string `json:\"watch\"`\n}\n```\nConfig is the scope \\[plugins.github.scope] configures.\n\n```go\ntype Query struct {\n\tReason string // author, review-requested, team-review-requested, watch, repo, discover\n\tQ      string\n}\n```\n\n```go\ntype Resolved struct {\n\tPeople []string // sorted, lower-case, unique: scope people plus team members\n\tTeams  []string\n\t// MyTeams are the teams of Teams the viewer belongs to.\n\tMyTeams []string\n\tRepos   []string // sorted, unique; the slow sweep appends discovered ones\n\tWatch   []string\n\tViewer  string\n}\n```\n\n```go\nfunc Resolve(ctx context.Context, cfg Config, viewer string, teams TeamReader) (Resolved, []error)\n```\n\n```go\nfunc (r Resolved) ClosedQueries(since time.Time) []Query\n```\nClosedQueries find the pull requests of the area and of the scope repositories closed or merged since the given instant.\n\n```go\nfunc (r Resolved) DiscoveryQueries(since time.Time) []Query\n```\nDiscoveryQueries find where the area opened pull requests since the given instant, any state.\n\n```go\nfunc (r *Resolved) Normalize()\n```\nNormalize sorts and dedupes every list.\n\n```go\nfunc (r Resolved) Queries(since time.Time) []Query\n```\nQueries builds the searches of a fast sweep. With a zero since they list the open pull requests; otherwise they return the pull requests updated at or after since in any state, so a close or merge in the window is seen. Every query stays under MaxQueryLen.\n\n```go\nfunc (r Resolved) Reasons(author, ownerRepo string, requested []string) []string\n```\n\n```go\ntype TeamReader interface {\n\tTeamMembers(ctx context.Context, org, slug string) ([]string, error)\n}\n```\n\n","path":"github.com/wloophq/wloop/plugins/github/scope","name":"scope","synopsis":"Package scope turns the configured sources into the people, teams and repositories the inventory follows, and the searches that find them.","isRedistributable":true}
