Documentation ¶
Overview ¶
GoWriter helps to create specific writers, eventually to use in a logging service like https://github.com/joaosoft/go-log
examples at https://github.com/joaosoft/writer/tree/master/example
Index ¶
- Constants
- func JsonFormatHandler(prefixes map[string]interface{}, tags map[string]interface{}, ...) ([]byte, error)
- func TextFormatHandler(prefixes map[string]interface{}, tags map[string]interface{}, ...) ([]byte, error)
- type FileConfig
- type FileWriter
- type FileWriterOption
- func WithFileDirectory(directory string) FileWriterOption
- func WithFileFlushTime(flushTime time.Duration) FileWriterOption
- func WithFileFormatHandler(formatHandler FormatHandler) FileWriterOption
- func WithFileMaxMegaByteSize(fileMaxSize int64) FileWriterOption
- func WithFileName(fileName string) FileWriterOption
- func WithFileQuitChannel(quit chan bool) FileWriterOption
- type FormatHandler
- type IList
- type Message
- type Mode
- type Queue
- type QueueOption
- type StdoutWriter
- type StdoutWriterOption
Constants ¶
View Source
const (
MB_IN_BYTE = 1000000
)
Variables ¶
This section is empty.
Functions ¶
func JsonFormatHandler ¶
Types ¶
type FileConfig ¶
type FileConfig struct {
// contains filtered or unexported fields
}
FileConfig ...
type FileWriter ¶
type FileWriter struct {
// contains filtered or unexported fields
}
FileWriter ...
func (*FileWriter) Reconfigure ¶
func (fileWriter *FileWriter) Reconfigure(options ...FileWriterOption)
Reconfigure ...
type FileWriterOption ¶
type FileWriterOption func(fileWriter *FileWriter)
StdoutWriterOption ...
func WithFileDirectory ¶
func WithFileDirectory(directory string) FileWriterOption
WithFileDirectory ...
func WithFileFlushTime ¶
func WithFileFlushTime(flushTime time.Duration) FileWriterOption
WithFileFlushTime ...
func WithFileFormatHandler ¶
func WithFileFormatHandler(formatHandler FormatHandler) FileWriterOption
WithFileFormatHandler ...
func WithFileMaxMegaByteSize ¶
func WithFileMaxMegaByteSize(fileMaxSize int64) FileWriterOption
WithFileMaxMegaByteSize ...
func WithFileQuitChannel ¶
func WithFileQuitChannel(quit chan bool) FileWriterOption
WithFileQuitChannel ...
type FormatHandler ¶
type IList ¶
type IList interface { Add(id string, data interface{}) error Remove(ids ...string) interface{} Size() int IsEmpty() bool Dump() string }
IList ...
type StdoutWriter ¶
type StdoutWriter struct {
// contains filtered or unexported fields
}
StdoutWriter ...
func NewStdoutWriter ¶
func NewStdoutWriter(options ...StdoutWriterOption) *StdoutWriter
NewStdoutWriter ...
func (*StdoutWriter) Reconfigure ¶
func (stdoutWriter *StdoutWriter) Reconfigure(options ...StdoutWriterOption)
Reconfigure ...
type StdoutWriterOption ¶
type StdoutWriterOption func(fileWriter *StdoutWriter)
StdoutWriterOption ...
func WithStdoutFlushTime ¶
func WithStdoutFlushTime(flushTime time.Duration) StdoutWriterOption
WithStdoutFlushTime ...
func WithStdoutFormatHandler ¶
func WithStdoutFormatHandler(formatHandler FormatHandler) StdoutWriterOption
WithStdoutFormatHandler ...
func WithStdoutQuitChannel ¶
func WithStdoutQuitChannel(quit chan bool) StdoutWriterOption
WithStdoutQuitChannel ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.