Documentation ¶
Index ¶
- Constants
- Variables
- type ErrFilteredT
- type ForkConfig
- type ForkedOutcome
- type FormattedOutcome
- type GoogleGithubRepoProvider
- func (rp *GoogleGithubRepoProvider) Cancel()
- func (rp *GoogleGithubRepoProvider) CreatePullRequest(pr *PullRequestT, branchNameBase string) (err error)
- func (rp *GoogleGithubRepoProvider) FetchLeaf(leaf Leaf, spec *RepoListSpec) (fetched []interface{}, err error)
- func (rp *GoogleGithubRepoProvider) FetchRepo(r *RepoT) (rawRepo interface{}, err error)
- func (rp *GoogleGithubRepoProvider) FilterOwner(rawOwner interface{}, spec *OwnerListSpec) (err *ErrFilteredT)
- func (rp *GoogleGithubRepoProvider) FilterRepo(rawRepo interface{}, spec *RepoListSpec) (err *ErrFilteredT)
- func (rp *GoogleGithubRepoProvider) ForkRepo(config *ForkConfig, oR *RepoT) (origAndForked [2]*RepoT, err error)
- func (rp *GoogleGithubRepoProvider) GetClient() *http.Client
- func (rp *GoogleGithubRepoProvider) ToOwner(rawOwner interface{}) (owner *Owner, ok bool)
- func (rp *GoogleGithubRepoProvider) ToRepo(rawRepo interface{}) (repo *RepoT, ok bool)
- type Leaf
- type LeafHeader
- type ListSpec
- type MatchNSpec
- type MatchTextSpec
- type MatchTimeSpec
- type OrganizationListSpec
- type Outcome
- type OutcomeStatus
- type Owner
- type OwnerListSpec
- type OwnerPool
- type Provider
- type PullRequestConfig
- type PullRequestT
- type QueryBranchConfig
- type RemoteError
- type RepoListSpec
- type RepoPool
- func (rp *RepoPool) GetOutcome(r *RepoT) *Outcome
- func (rp *RepoPool) GetWhere(filter func(r *RepoT, o *Outcome) bool) (repos []*RepoT)
- func (rp *RepoPool) Len() int
- func (rp *RepoPool) Random1() *RepoT
- func (rp *RepoPool) Remove(r *RepoT)
- func (rp *RepoPool) Repos() (repos []*RepoT)
- func (rp *RepoPool) Set(r *RepoT, o *Outcome)
- type RepoT
- type Resource
- type SearchOptions
- type UserListSpec
Constants ¶
View Source
const PageMax = 2
View Source
const PerPage = 50 // 100 is max
Variables ¶
View Source
var AvailableLeafHeaders = []LeafHeader{ Following, Followers, Starred, Authored, Stargazers, Members, OrgRepos, }
View Source
var Branches = map[LeafHeader][]LeafHeader{ OrgRepos: {Members}, Members: {Starred, Authored, Following, Followers}, Stargazers: {Starred, Authored, Following, Followers}, Starred: {Stargazers}, Authored: {Stargazers}, Following: {Starred, Authored}, Followers: {Starred, Authored}, }
these are completely fucked. i don't understand what i'm trying to do here.
Functions ¶
This section is empty.
Types ¶
type ErrFilteredT ¶
func (*ErrFilteredT) String ¶
func (e *ErrFilteredT) String() string
type ForkConfig ¶
type ForkConfig struct {
Org string // organization to fork repo to; if empty will fork to auth'd user
}
type ForkedOutcome ¶
func (*ForkedOutcome) String ¶
func (fo *ForkedOutcome) String() string
type FormattedOutcome ¶
func (*FormattedOutcome) String ¶
func (fo *FormattedOutcome) String() string
type GoogleGithubRepoProvider ¶
type GoogleGithubRepoProvider struct {
// contains filtered or unexported fields
}
GoogleGithubRepoProvider implements the Provider interface using the google/go-github API package.
func NewGoogleGithubProvider ¶
func NewGoogleGithubProvider(username, token string) *GoogleGithubRepoProvider
func (*GoogleGithubRepoProvider) Cancel ¶
func (rp *GoogleGithubRepoProvider) Cancel()
func (*GoogleGithubRepoProvider) CreatePullRequest ¶
func (rp *GoogleGithubRepoProvider) CreatePullRequest(pr *PullRequestT, branchNameBase string) (err error)
func (*GoogleGithubRepoProvider) FetchLeaf ¶
func (rp *GoogleGithubRepoProvider) FetchLeaf(leaf Leaf, spec *RepoListSpec) (fetched []interface{}, err error)
func (*GoogleGithubRepoProvider) FetchRepo ¶
func (rp *GoogleGithubRepoProvider) FetchRepo(r *RepoT) (rawRepo interface{}, err error)
func (*GoogleGithubRepoProvider) FilterOwner ¶
func (rp *GoogleGithubRepoProvider) FilterOwner(rawOwner interface{}, spec *OwnerListSpec) (err *ErrFilteredT)
func (*GoogleGithubRepoProvider) FilterRepo ¶
func (rp *GoogleGithubRepoProvider) FilterRepo(rawRepo interface{}, spec *RepoListSpec) (err *ErrFilteredT)
func (*GoogleGithubRepoProvider) ForkRepo ¶
func (rp *GoogleGithubRepoProvider) ForkRepo(config *ForkConfig, oR *RepoT) (origAndForked [2]*RepoT, err error)
func (*GoogleGithubRepoProvider) GetClient ¶
func (rp *GoogleGithubRepoProvider) GetClient() *http.Client
func (*GoogleGithubRepoProvider) ToOwner ¶
func (rp *GoogleGithubRepoProvider) ToOwner(rawOwner interface{}) (owner *Owner, ok bool)
func (*GoogleGithubRepoProvider) ToRepo ¶
func (rp *GoogleGithubRepoProvider) ToRepo(rawRepo interface{}) (repo *RepoT, ok bool)
type Leaf ¶
type Leaf struct { Header LeafHeader ID string // eg. rotblauer or rotblauger/go-fmtatt }
type LeafHeader ¶
type LeafHeader string
const ( Followers LeafHeader = "user_followers" Following = "user_following" )
Owner-user leafs
const ( Starred LeafHeader = "user_starred" Authored = "user_authored" )
Owner-repo leafs
const (
Members LeafHeader = "org_members"
)
Org-user leafs
const (
OrgRepos LeafHeader = "org_owns"
)
Org-repo leafs
const (
Stargazers LeafHeader = "repo_stargazers"
)
Repo-user leafs
func (LeafHeader) BranchesFromOrg ¶
func (l LeafHeader) BranchesFromOrg() bool
func (LeafHeader) BranchesFromRepo ¶
func (l LeafHeader) BranchesFromRepo() bool
func (LeafHeader) BranchesFromUser ¶
func (l LeafHeader) BranchesFromUser() bool
func (LeafHeader) IsListOfRepos ¶
func (l LeafHeader) IsListOfRepos() bool
type ListSpec ¶
type ListSpec struct { *RepoListSpec *OwnerListSpec }
type MatchNSpec ¶
type MatchNSpec struct {
Min, Max int64
}
type MatchTextSpec ¶
type MatchTimeSpec ¶
type OrganizationListSpec ¶
type OrganizationListSpec struct {
OwnerListSpec
}
type Outcome ¶
type Outcome struct { Status OutcomeStatus Error string // gotcha. Error, not Err // nope. fuck it. FilteredE *ErrFilteredT Timestamp time.Time FormattedOutcome *FormattedOutcome ForkedOutcome *ForkedOutcome PROutcome *PullRequestT }
type OutcomeStatus ¶
type OutcomeStatus int
const ( DBErr OutcomeStatus = iota // unknown to db Invalid // filtered out by metadata Clean // fmting did nothing (repo worktree was clean) Valid // cleared by metadata for formatting Dirty // fmting did something Committed Forked // did fork PullRequested // did pr )
type OwnerListSpec ¶
type OwnerListSpec struct { Owner FollowingN *MatchNSpec FollowersN *MatchNSpec PublicReposN *MatchNSpec PublicGistsN *MatchNSpec CollaboratorsN *MatchNSpec Hireable string // "true", "false", "" }
OwnerListSpec can be user or org
type OwnerPool ¶
type OwnerPool []*Owner
type Provider ¶
type Provider interface { GetClient() *http.Client FetchRepo(repo *RepoT) (rawRepo interface{}, err error) FetchLeaf(leaf Leaf, spec *RepoListSpec) (fetched []interface{}, err error) FilterRepo(rawRepo interface{}, spec *RepoListSpec) (err *ErrFilteredT) FilterOwner(rawOwner interface{}, spec *OwnerListSpec) (err *ErrFilteredT) ToRepo(rawRepo interface{}) (repo *RepoT, ok bool) ToOwner(rawUser interface{}) (owner *Owner, ok bool) ForkRepo(config *ForkConfig, rs *RepoT) (repos [2]*RepoT, err error) CreatePullRequest(pr *PullRequestT, branchNameBase string) (err error) Cancel() }
type PullRequestConfig ¶
type PullRequestConfig struct { Title string Head string `json:"-",toml:"-",yaml:"-"` // (branch name to Set Set changes to; create PR rom) Default to an automatic probably-unique one, like types-20180606 Base string `json:"-",toml:"-",yaml:"-"` // Default to 'master' Body string BodyFile string OrgFork string // Organization name }
type PullRequestT ¶
type PullRequestT struct { *RepoT *PullRequestConfig // on success, we store these Number int ID int64 }
func (*PullRequestT) String ¶
func (pr *PullRequestT) String() string
type QueryBranchConfig ¶
type QueryBranchConfig struct { MaxDistance int // tricky Branching map[LeafHeader]float64 }
type RemoteError ¶
func (RemoteError) String ¶
func (r RemoteError) String() string
type RepoListSpec ¶
type RepoListSpec struct { *SearchOptions OwnerType string // "user" OR "org" OR "" for either Visibility string // "private", "public", "all" Affiliation string // owner,collaborator,organization_member Owner *MatchTextSpec Name *MatchTextSpec Language *MatchTextSpec Conduct *MatchTextSpec // eg. "NO ROBOTS" :( or "ROBOTS WECOME"! Description *MatchTextSpec IsFork bool IsPrivate bool Archived bool StargazersCount *MatchNSpec ForksCount *MatchNSpec WatchersCount *MatchNSpec NetworkCount *MatchNSpec Size *MatchNSpec CreatedAt *MatchTimeSpec UpdatedAt *MatchTimeSpec FmtExpiration time.Duration `json:"-",toml:"-",yaml:"-"` // parse the below to this on init FmtExpiry int // in DAYS. }
type RepoPool ¶
type RepoPool struct {
// contains filtered or unexported fields
}
func NewRepoPool ¶
func NewRepoPool() *RepoPool
func (*RepoPool) GetOutcome ¶
type RepoT ¶
type RepoT struct { Owner *Owner Name string Target string // filepath of clone CloneUrl string GitUrl string HTMLUrl string }
func RepoizeRef ¶
type SearchOptions ¶
type UserListSpec ¶
type UserListSpec struct {
OwnerListSpec
}
Click to show internal directories.
Click to hide internal directories.