This commit is contained in:
Alex Dadgar 2017-01-23 16:06:31 -08:00
parent ab330b96aa
commit 9152477890
2 changed files with 12 additions and 2 deletions

View file

@ -255,6 +255,7 @@ func (s *StreamFrame) IsCleared() bool {
// StreamFramer is used to buffer and send frames as well as heartbeat.
type StreamFramer struct {
// plainTxt determines whether we frame or just send plain text data.
plainTxt bool
out io.WriteCloser
@ -283,8 +284,11 @@ type StreamFramer struct {
}
// NewStreamFramer creates a new stream framer that will output StreamFrames to
// the passed output.
func NewStreamFramer(out io.WriteCloser, plainTxt bool, heartbeatRate, batchWindow time.Duration, frameSize int) *StreamFramer {
// the passed output. If plainTxt is set we do not frame and just batch plain
// text data.
func NewStreamFramer(out io.WriteCloser, plainTxt bool,
heartbeatRate, batchWindow time.Duration, frameSize int) *StreamFramer {
// Create a JSON encoder
enc := codec.NewEncoder(out, jsonHandle)

View file

@ -227,6 +227,12 @@ allocation was placed.
Origin can be either "start" or "end" and applies the offset relative to
either the start or end of the logs respectively. Defaults to "start".
</li>
<li>
<span class="param">plain</span>
A boolean of whether to return just the plain text without framing. If
set, follow is automatically unset. This can be usef when viewing logs
in a browser.
</li>
</ul>
</dd>