diff --git a/plugins/registry.go b/plugins/registry.go deleted file mode 100644 index e577592e8..000000000 --- a/plugins/registry.go +++ /dev/null @@ -1,45 +0,0 @@ -package plugins - -import ( - "fmt" - - "github.com/drone/drone/model" -) - -type registryPlugin struct { - endpoint string -} - -// NewRegistry returns a new registry plugin. -func NewRegistry(endpoint string) interface{} { - return registryPlugin{endpoint} -} - -func (r *registryPlugin) RegistryFind(repo *model.Repo, name string) (*model.Registry, error) { - path := fmt.Sprintf("%s/registry/%s/%s/%s", r.endpoint, repo.Owner, repo.Name, name) - out := new(model.Registry) - err := do("GET", path, nil, out) - return out, err -} - -func (r *registryPlugin) RegistryList(repo *model.Repo) ([]*model.Registry, error) { - path := fmt.Sprintf("%s/registry/%s/%s", r.endpoint, repo.Owner, repo.Name) - out := []*model.Registry{} - err := do("GET", path, nil, out) - return out, err -} - -func (r *registryPlugin) RegistryCreate(repo *model.Repo, in *model.Registry) error { - path := fmt.Sprintf("%s/registry/%s/%s", r.endpoint, repo.Owner, repo.Name) - return do("PATCH", path, in, nil) -} - -func (r *registryPlugin) RegistryUpdate(repo *model.Repo, in *model.Registry) error { - path := fmt.Sprintf("%s/registry/%s/%s/%s", r.endpoint, repo.Owner, repo.Name, in.Address) - return do("PATCH", path, in, nil) -} - -func (r *registryPlugin) RegistryDelete(repo *model.Repo, name string) error { - path := fmt.Sprintf("%s/registry/%s/%s/%s", r.endpoint, repo.Owner, repo.Name, name) - return do("DELETE", path, nil, nil) -} diff --git a/plugins/secrets.go b/plugins/secrets.go deleted file mode 100644 index a329f2a7a..000000000 --- a/plugins/secrets.go +++ /dev/null @@ -1,45 +0,0 @@ -package plugins - -import ( - "fmt" - - "github.com/drone/drone/model" -) - -type secretPlugin struct { - endpoint string -} - -// NewSecret returns a new secret plugin. -func NewSecret(endpoint string) interface{} { - return secretPlugin{endpoint} -} - -func (s *secretPlugin) SecretFind(repo *model.Repo, name string) (*model.Secret, error) { - path := fmt.Sprintf("%s/secrets/%s/%s/%s", s.endpoint, repo.Owner, repo.Name, name) - out := new(model.Secret) - err := do("GET", path, nil, out) - return out, err -} - -func (s *secretPlugin) SecretList(repo *model.Repo) ([]*model.Secret, error) { - path := fmt.Sprintf("%s/secrets/%s/%s", s.endpoint, repo.Owner, repo.Name) - out := []*model.Secret{} - err := do("GET", path, nil, out) - return out, err -} - -func (s *secretPlugin) SecretCreate(repo *model.Repo, in *model.Secret) error { - path := fmt.Sprintf("%s/secrets/%s/%s", s.endpoint, repo.Owner, repo.Name) - return do("POST", path, in, nil) -} - -func (s *secretPlugin) SecretUpdate(repo *model.Repo, in *model.Secret) error { - path := fmt.Sprintf("%s/secrets/%s/%s/%s", s.endpoint, repo.Owner, repo.Name, in.Name) - return do("PATCH", path, in, nil) -} - -func (s *secretPlugin) SecretDelete(repo *model.Repo, name string) error { - path := fmt.Sprintf("%s/secrets/%s/%s/%s", s.endpoint, repo.Owner, repo.Name, name) - return do("DELETE", path, nil, nil) -}