mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
add NewDockerLogs constructor method
This commit is contained in:
parent
53c0f2a9df
commit
3e5176a79c
@ -66,7 +66,7 @@ func (c *Docker) Stream() chan models.Metrics {
|
||||
}
|
||||
|
||||
func (c *Docker) Logs() LogCollector {
|
||||
return &DockerLogs{c.id, c.client, make(chan bool)}
|
||||
return NewDockerLogs(c.id, c.client)
|
||||
}
|
||||
|
||||
// Stop collector
|
||||
|
@ -17,6 +17,14 @@ type DockerLogs struct {
|
||||
done chan bool
|
||||
}
|
||||
|
||||
func NewDockerLogs(id string, client *api.Client) *DockerLogs {
|
||||
return &DockerLogs{
|
||||
id: id,
|
||||
client: client,
|
||||
done: make(chan bool),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DockerLogs) Stream() chan models.Log {
|
||||
r, w := io.Pipe()
|
||||
logCh := make(chan models.Log)
|
||||
|
Loading…
Reference in New Issue
Block a user