mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
update vendor/ dir to latest w/o heroku, moby
had to lock a lot of things in place
This commit is contained in:
47
vendor/github.com/fsouza/go-dockerclient/service.go
generated
vendored
47
vendor/github.com/fsouza/go-dockerclient/service.go
generated
vendored
@@ -6,9 +6,11 @@ package docker
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api/types/swarm"
|
||||
"golang.org/x/net/context"
|
||||
@@ -167,3 +169,48 @@ func (c *Client) ListServices(opts ListServicesOptions) ([]swarm.Service, error)
|
||||
}
|
||||
return services, nil
|
||||
}
|
||||
|
||||
// LogsServiceOptions represents the set of options used when getting logs from a
|
||||
// service.
|
||||
type LogsServiceOptions struct {
|
||||
Context context.Context
|
||||
Service string `qs:"-"`
|
||||
OutputStream io.Writer `qs:"-"`
|
||||
ErrorStream io.Writer `qs:"-"`
|
||||
InactivityTimeout time.Duration `qs:"-"`
|
||||
Tail string
|
||||
|
||||
// Use raw terminal? Usually true when the container contains a TTY.
|
||||
RawTerminal bool `qs:"-"`
|
||||
Since int64
|
||||
Follow bool
|
||||
Stdout bool
|
||||
Stderr bool
|
||||
Timestamps bool
|
||||
Details bool
|
||||
}
|
||||
|
||||
// GetServiceLogs gets stdout and stderr logs from the specified service.
|
||||
//
|
||||
// When LogsServiceOptions.RawTerminal is set to false, go-dockerclient will multiplex
|
||||
// the streams and send the containers stdout to LogsServiceOptions.OutputStream, and
|
||||
// stderr to LogsServiceOptions.ErrorStream.
|
||||
//
|
||||
// When LogsServiceOptions.RawTerminal is true, callers will get the raw stream on
|
||||
// LogsServiceOptions.OutputStream.
|
||||
func (c *Client) GetServiceLogs(opts LogsServiceOptions) error {
|
||||
if opts.Service == "" {
|
||||
return &NoSuchService{ID: opts.Service}
|
||||
}
|
||||
if opts.Tail == "" {
|
||||
opts.Tail = "all"
|
||||
}
|
||||
path := "/services/" + opts.Service + "/logs?" + queryString(opts)
|
||||
return c.stream("GET", path, streamOptions{
|
||||
setRawTerminal: opts.RawTerminal,
|
||||
stdout: opts.OutputStream,
|
||||
stderr: opts.ErrorStream,
|
||||
inactivityTimeout: opts.InactivityTimeout,
|
||||
context: opts.Context,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user