mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 20:31:10 +00:00
28 lines
477 B
Go
28 lines
477 B
Go
|
package client
|
||
|
|
||
|
const (
|
||
|
droneServiceUrl = "/projects/:id/services/drone-ci"
|
||
|
)
|
||
|
|
||
|
func (c *Client) AddDroneService(id string, params QMap) error {
|
||
|
url, opaque := c.ResourceUrl(
|
||
|
droneServiceUrl,
|
||
|
QMap{":id": id},
|
||
|
params,
|
||
|
)
|
||
|
|
||
|
_, err := c.Do("PUT", url, opaque, nil)
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
func (c *Client) DeleteDroneService(id string) error {
|
||
|
url, opaque := c.ResourceUrl(
|
||
|
droneServiceUrl,
|
||
|
QMap{":id": id},
|
||
|
nil,
|
||
|
)
|
||
|
|
||
|
_, err := c.Do("DELETE", url, opaque, nil)
|
||
|
return err
|
||
|
}
|