mirror of
https://github.com/amir20/dozzle.git
synced 2026-06-23 04:10:12 +00:00
13da2a4222
Push container / Push branches and PRs (push) Waiting to run
Deploy VitePress site to Pages / build (push) Waiting to run
Deploy VitePress site to Pages / Deploy (push) Blocked by required conditions
Test / Typecheck (push) Waiting to run
Test / JavaScript Tests (push) Waiting to run
Test / Go Tests (push) Waiting to run
Test / Go Staticcheck (push) Waiting to run
Test / Integration Tests (push) Waiting to run
28 lines
434 B
Go
28 lines
434 B
Go
package k8s
|
|
|
|
import (
|
|
"bufio"
|
|
"io"
|
|
|
|
"github.com/amir20/dozzle/internal/container"
|
|
)
|
|
|
|
type LogReader struct {
|
|
reader *bufio.Reader
|
|
}
|
|
|
|
func NewLogReader(reader io.ReadCloser) *LogReader {
|
|
return &LogReader{
|
|
reader: bufio.NewReader(reader),
|
|
}
|
|
}
|
|
|
|
func (r *LogReader) Read() (string, container.StdType, error) {
|
|
line, err := r.reader.ReadString('\n')
|
|
if err != nil {
|
|
return "", 0, err
|
|
}
|
|
|
|
return line, container.STDOUT, nil
|
|
}
|