Update vendor

This commit is contained in:
Ettore Di Giacinto
2020-04-18 11:42:34 +02:00
parent 64bac0823c
commit a14f0abb5c
533 changed files with 28836 additions and 20391 deletions

View File

@@ -46,7 +46,7 @@ func (c *Client) CreateService(opts CreateServiceOptions) (*swarm.Service, error
return nil, err
}
path := "/services/create?" + queryString(opts)
resp, err := c.do("POST", path, doOptions{
resp, err := c.do(http.MethodPost, path, doOptions{
headers: headers,
data: opts.ServiceSpec,
forceJSON: true,
@@ -76,7 +76,7 @@ type RemoveServiceOptions struct {
// See https://goo.gl/Tqrtya for more details.
func (c *Client) RemoveService(opts RemoveServiceOptions) error {
path := "/services/" + opts.ID
resp, err := c.do("DELETE", path, doOptions{context: opts.Context})
resp, err := c.do(http.MethodDelete, path, doOptions{context: opts.Context})
if err != nil {
if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
return &NoSuchService{ID: opts.ID}
@@ -106,7 +106,7 @@ func (c *Client) UpdateService(id string, opts UpdateServiceOptions) error {
if err != nil {
return err
}
resp, err := c.do("POST", "/services/"+id+"/update?"+queryString(opts), doOptions{
resp, err := c.do(http.MethodPost, "/services/"+id+"/update?"+queryString(opts), doOptions{
headers: headers,
data: opts.ServiceSpec,
forceJSON: true,
@@ -127,7 +127,7 @@ func (c *Client) UpdateService(id string, opts UpdateServiceOptions) error {
// See https://goo.gl/dHmr75 for more details.
func (c *Client) InspectService(id string) (*swarm.Service, error) {
path := "/services/" + id
resp, err := c.do("GET", path, doOptions{})
resp, err := c.do(http.MethodGet, path, doOptions{})
if err != nil {
if e, ok := err.(*Error); ok && e.Status == http.StatusNotFound {
return nil, &NoSuchService{ID: id}
@@ -147,6 +147,7 @@ func (c *Client) InspectService(id string) (*swarm.Service, error) {
// See https://goo.gl/DwvNMd for more details.
type ListServicesOptions struct {
Filters map[string][]string
Status bool
Context context.Context
}
@@ -155,7 +156,7 @@ type ListServicesOptions struct {
// See https://goo.gl/DwvNMd for more details.
func (c *Client) ListServices(opts ListServicesOptions) ([]swarm.Service, error) {
path := "/services?" + queryString(opts)
resp, err := c.do("GET", path, doOptions{context: opts.Context})
resp, err := c.do(http.MethodGet, path, doOptions{context: opts.Context})
if err != nil {
return nil, err
}
@@ -176,10 +177,10 @@ type LogsServiceOptions struct {
ErrorStream io.Writer `qs:"-"`
InactivityTimeout time.Duration `qs:"-"`
Tail string
Since int64
// Use raw terminal? Usually true when the container contains a TTY.
RawTerminal bool `qs:"-"`
Since int64
Follow bool
Stdout bool
Stderr bool
@@ -203,7 +204,7 @@ func (c *Client) GetServiceLogs(opts LogsServiceOptions) error {
opts.Tail = "all"
}
path := "/services/" + opts.Service + "/logs?" + queryString(opts)
return c.stream("GET", path, streamOptions{
return c.stream(http.MethodGet, path, streamOptions{
setRawTerminal: opts.RawTerminal,
stdout: opts.OutputStream,
stderr: opts.ErrorStream,