Documentation ¶
Index ¶
- Variables
- func ComponentNames() []string
- func CreateTags(client *github.Client, repos []RepoAndSha, tag string) error
- func DownloadContents(ghClient *github.Client, org, repo, filepath string, ...) (io.ReadCloser, error)
- func GetLastTag(ghClient *github.Client, repos []string) (map[string]*github.RepositoryTag, error)
- func MoveMilestone(ghClient *github.Client, repo string, oldMilestoneName string, ...) error
- func NoTransform(s string) string
- func RepoNames() []string
- func RepoToComponentNames() map[string][]string
- func ShortSHATransform(s string) (string, error)
- func ShortSHATransformNoErr(s string) string
- type File
- type RepoAndSha
- type RepoAndShaList
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSHANotLongEnough is the error returned from various functions in this package when a // given SHA is not long enough for use ErrSHANotLongEnough = errors.New("SHA not long enough") )
Functions ¶
func ComponentNames ¶
func ComponentNames() []string
ComponentNames returns a slice of known component names
func CreateTags ¶
func CreateTags(client *github.Client, repos []RepoAndSha, tag string) error
CreateTags tags each repository at the corresponding SHA with the tag supplied
func DownloadContents ¶
func DownloadContents( ghClient *github.Client, org, repo, filepath string, opt *github.RepositoryContentGetOptions) (io.ReadCloser, error)
DownloadContents downloads filepath from org/repo on Github. If error is non-nil, the returned io.ReadCloser will contain the full contents of the file
func GetLastTag ¶
GetLastTag returns the latest tag for each of the repos in repos. It is not yet implemented
func MoveMilestone ¶
func NoTransform ¶
NoTransform returns a git sha without any transformation on it. This function exists as a pair with ShortShaTransform. It's purposefully the identity function
func RepoToComponentNames ¶
RepoToComponentNames returns a mapping from each repository name to its known component names
func ShortSHATransform ¶
ShortSHATransform returns the shortened version of the given SHA given in s. If the given string is not long enough, returns the empty string and ErrSHANotLongEnough
func ShortSHATransformNoErr ¶
ShortSHATransformNoErr calls ShortSHATransform. If that call returns an error, return s. Otherwise return its string return value
Types ¶
type File ¶
type File struct { ReadCloser io.ReadCloser Name string }
File is the representation of a downloaded file on github
type RepoAndSha ¶
RepoAndSha is the representation of a Git repo and a SHA in that repo
func CreateBranches ¶
func CreateBranches(ghClient *github.Client, branchName string, reposAndSHAs []RepoAndSha) ([]RepoAndSha, error)
CreateBranches creates branches called branchName in all of the repos listed in reposAndSHAs, each from the given SHA in that element. Returns a slice of RepoAndSha, each with the repo name and sha given. The returned slice will not necessarily be in the same order as reposAndSHAs. Finally, this func returns a nil slice and a non-nil error if any create branch operation failed
func GetSHAs ¶
func GetSHAs(ghClient *github.Client, repos []string, transform func(string) string, ref string) ([]RepoAndSha, error)
GetSHAs returns a slice of the latest RepoAndSha for each repository, using ghClient. It transforms each SHA that it finds using the transform function. It uses the ref parameter to determine the SHA or branch from which to list commits
func GetShasFromFilepath ¶
func GetShasFromFilepath(path string) ([]RepoAndSha, error)
GetShasFromFilepath opens the file at path and reads all the git repos and SHAs in the file. Returns a slice of all the RepoAndShas that correspond to each entry in the file, or an empty slice and non-nil error if there was any error
func (RepoAndSha) ShortSHA ¶
func (r RepoAndSha) ShortSHA() string
ShortSHA returns the shortened SHA of r. If the SHA is already short, then returns just r.SHA
func (RepoAndSha) String ¶
func (r RepoAndSha) String() string
String is the fmt.Stringer interface implementation
type RepoAndShaList ¶
type RepoAndShaList struct {
// contains filtered or unexported fields
}
RepoAndShaList is a sortable list of RepoAndSha structs, sortable on the repo name
func NewEmptyRepoAndShaList ¶
func NewEmptyRepoAndShaList() *RepoAndShaList
NewEmptyRepoAndShaList creates a new RepoAndShaList with no items in it
func NewRepoAndShaListFromSlice ¶
func NewRepoAndShaListFromSlice(rasl []RepoAndSha) *RepoAndShaList
NewRepoAndShaListFromSlice returns a new RepoAndShaList with all items in rasl added (in order)
func (*RepoAndShaList) Add ¶
func (r *RepoAndShaList) Add(ras RepoAndSha)
Add adds a new RepoAndSha to the internal list
func (*RepoAndShaList) Slice ¶
func (r *RepoAndShaList) Slice() []RepoAndSha
Slice returns a slice of the RepoAndShas that are stored internally, in the same order
func (*RepoAndShaList) Sort ¶
func (r *RepoAndShaList) Sort()
Sort sorts the internal repo list by name
func (RepoAndShaList) String ¶
func (r RepoAndShaList) String() string
String is the fmt.Stringer interface implementation