ability to override the public private key for a repository via the CLI

This commit is contained in:
Brad Rydzewski
2015-01-04 15:21:35 -08:00
parent f890d42019
commit b4ca338948
3 changed files with 59 additions and 0 deletions

View File

@@ -38,6 +38,16 @@ func (s *RepoService) Disable(host, owner, name string) error {
return s.run("DELETE", path, nil, nil)
}
// PUT /api/repos/{host}/{owner}/{name}
func (s *RepoService) SetKey(host, owner, name, pub, priv string) error {
var path = fmt.Sprintf("/api/repos/%s/%s/%s", host, owner, name)
var in = struct {
PublicKey string `json:"public_key"`
PrivateKey string `json:"private_key"`
}{pub, priv}
return s.run("PUT", path, &in, nil)
}
// GET /api/user/repos
func (s *RepoService) List() ([]*model.Repo, error) {
var repos []*model.Repo