jsonlog

package
v1.10.0-experimental Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteLog

func WriteLog(src io.Reader, dst io.Writer, format string) error

Types

type JSONLog

type JSONLog struct {
	Log     string    `json:"log,omitempty"`
	Stream  string    `json:"stream,omitempty"`
	Created time.Time `json:"time"`
}

func (*JSONLog) Format

func (jl *JSONLog) Format(format string) (string, error)

func (*JSONLog) MarshalJSON

func (mj *JSONLog) MarshalJSON() ([]byte, error)

func (*JSONLog) MarshalJSONBuf

func (mj *JSONLog) MarshalJSONBuf(buf *bytes.Buffer) error

func (*JSONLog) Reset

func (jl *JSONLog) Reset()

type JSONLogBytes

type JSONLogBytes struct {
	Log     []byte `json:"log,omitempty"`
	Stream  string `json:"stream,omitempty"`
	Created string `json:"time"`
}

JSONLogBytes is based on JSONLog. It allows marshalling JSONLog from Log as []byte and an already marshalled Created timestamp.

func (*JSONLogBytes) MarshalJSONBuf

func (mj *JSONLogBytes) MarshalJSONBuf(buf *bytes.Buffer) error

MarshalJSONBuf is based on the same method from JSONLog It has been modified to take into account the necessary changes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL