Mercurial and Git clients can push and pull from this alias URL to interact with this repository. You can change to which repository an alias points by going to the Aliases link on the project page.
packagekilnimport("encoding/json""fmt""strings")// Represents the error JSON returned by Kiln API requeststypeKilnErrorstruct{// Guaranteed-unique code for Kiln errorsCodestring`json:"codeError"`// Human-readable descriptionDescriptionstring`json:"sError"`}// Represents the project JSON returned from the Kiln APItypeKilnProjectstruct{Idint64`json:"ixProject"`Slugstring`json:"sSlug"`Namestring`json:"sName"`Descriptionstring`json:"sDescription"`DefaultPermissionstring`json:"permissionDefault"`RepoGroups[]KilnRepoGroup}typeKilnRepoGroupstruct{Idint64`json:"ixRepoGroup"`ProjectIdint64`json:"ixProject"`Slugstring`json:"sSlug"`Namestring`json:"sName"`Repos[]KilnRepo`json:"repos"`}typeKilnRepostruct{Idint64`json:"ixRepo"`RepoGroupIdint64`json:"ixRepoGroup"`ParentIdint64`json:"ixParent"`IsCentralbool`json:"fCentral"`Slugstring`json:"sSlug"`GroupSlugstring`json:"sGroupSlug"`ProjectSlugstring`json:"sProjectSlug"`GitUrlstring`json:"sGitUrl"`GitSshUrlstring`json:"sGitSshUrl"`Namestring`json:"sName"`Descriptionstring`json:"sDescription"`Statusstring`json:"sStatus"`Sizeint64`json:"bytesSize"`Vcsint`json:"vcs"`CreatorKilnPerson`json:"personCreator"`DefaultPermissionstring`json:"permissionDefault"`Branches[]KilnRepo`json:"repoBranches"`}typeKilnPersonstruct{Idint64`json:"ixPerson"`Namestring`json:"sName"`Emailstring`json:"sEmail"`}func(k*KilnClient)Projects()(projects[]KilnProject,errerror){ifresp,err:=k.apiGet("Project",apiParams{});err==nil{err=json.Unmarshal(resp,&projects)} return
}
-func (k *KilnClient) IdForRepo(repoPath string) (repoId int64, err error) {
+func (k *KilnClient) RepoForPath(repoPath string) (*KilnRepo, error) {
parts := strings.Split(repoPath, "/")
if len(parts) != 3 {
-err= fmt.Errorf("unknown repository target: %v", repoPath)
- return+returnnil, fmt.Errorf("unknown repository target: %v", repoPath)
}
- var projects []KilnProject- if projects, err = k.Projects(); err == nil {
+ if projects, err := k.Projects(); err == nil {
for _, project := range projects {
for _, repoGroup := range project.RepoGroups {
for _, repo := range repoGroup.Repos {
if strings.EqualFold(repo.ProjectSlug, parts[0]) &&
strings.EqualFold(repo.GroupSlug, parts[1]) &&
strings.EqualFold(repo.Slug, parts[2]) {
- repoId = repo.Id- return
+ return &repo, nil }
}
}
}
}
-err= fmt.Errorf("repository not found")
- return
+returnnil, fmt.Errorf("repository not found")
+}++func (k *KilnClient) IdForRepo(repoPath string) (int64, error) {+ repo, err := k.RepoForPath(repoPath)+ if err != nil {+ return -1, err+ }+ return repo.Id, nil}
func (k *KilnClient) RelatedRepos(repoPath string) (repos []KilnRepo, err error) {
repoId,err:=k.IdForRepo(repoPath)iferr==nil{resp,err:=k.apiGet(fmt.Sprintf("Repo/%v/Related",repoId),apiParams{})iferr==nil{err=json.Unmarshal(resp,&repos)}}return}
Attach a Trello Card
Add a tag
Your session has expired
You are no longer logged in. Please log in and try your request again.
Filter RSS Feed
This RSS feed URL allows you to see the contents of your current filter using any feed reader.
This link includes a special authentication token. If you share the URL with anyone else, they can see this RSS feed's activity. You can disable these tokens when needed.
Your current filter is unsaved; changing it won't affect this RSS feed.