Documentation ¶
Index ¶
- type BackpressureBuffer
- func (p BackpressureBuffer) Close() error
- func (p BackpressureBuffer) Flush() error
- func (p BackpressureBuffer) GetAvgWriteDuration() time.Duration
- func (p BackpressureBuffer) GetBareOutput() io.Writer
- func (p BackpressureBuffer) IsLowLatencySupported() bool
- func (p BackpressureBuffer) LogLevelWrite(level insolar.LogLevel, b []byte) (n int, err error)
- func (p BackpressureBuffer) LowLatencyWrite(level insolar.LogLevel, b []byte) (n int, err error)
- func (p BackpressureBuffer) SetAvgWriteDuration(d time.Duration)
- func (p *BackpressureBuffer) StartWorker(ctx context.Context) *BackpressureBuffer
- func (p BackpressureBuffer) Write(b []byte) (n int, err error)
- type BackpressureBufferFlags
- type FatalDirectWriter
- func (p *FatalDirectWriter) Close() error
- func (p *FatalDirectWriter) Flush() error
- func (p *FatalDirectWriter) GetBareOutput() io.Writer
- func (p *FatalDirectWriter) IsLowLatencySupported() bool
- func (p *FatalDirectWriter) LogLevelWrite(level insolar.LogLevel, b []byte) (n int, err error)
- func (p *FatalDirectWriter) LowLatencyWrite(level insolar.LogLevel, b []byte) (int, error)
- func (p *FatalDirectWriter) Write(b []byte) (n int, err error)
- type FatalHelper
- type FlushBypass
- func (p *FlushBypass) Close() error
- func (p *FlushBypass) ClosedError() error
- func (p *FlushBypass) DoClose() (bool, error)
- func (p *FlushBypass) DoFlush() (bool, error)
- func (p *FlushBypass) DoFlushOrSync() (bool, error)
- func (p *FlushBypass) DoLevelWrite(level insolar.LogLevel, b []byte) (n int, err error)
- func (p *FlushBypass) DoSync() (bool, error)
- func (p *FlushBypass) DoWrite(b []byte) (n int, err error)
- func (p *FlushBypass) Flush() error
- func (p *FlushBypass) FlushOrSync() error
- func (p *FlushBypass) IsClosed() bool
- func (p *FlushBypass) LogLevelWrite(level insolar.LogLevel, b []byte) (int, error)
- func (p *FlushBypass) SetClosed() bool
- func (p *FlushBypass) Sync() error
- func (p *FlushBypass) Write(b []byte) (int, error)
- type MissedEventFunc
- type ProxyLoggerOutput
- func (p *ProxyLoggerOutput) Close() error
- func (p *ProxyLoggerOutput) Flush() error
- func (p *ProxyLoggerOutput) GetBareOutput() io.Writer
- func (p *ProxyLoggerOutput) GetTarget() insolar.LoggerOutput
- func (p *ProxyLoggerOutput) IsLowLatencySupported() bool
- func (p *ProxyLoggerOutput) LogLevelWrite(level insolar.LogLevel, b []byte) (int, error)
- func (p *ProxyLoggerOutput) LowLatencyWrite(level insolar.LogLevel, b []byte) (int, error)
- func (p *ProxyLoggerOutput) SetTarget(t insolar.LoggerOutput)
- func (p *ProxyLoggerOutput) Write(b []byte) (n int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BackpressureBuffer ¶
type BackpressureBuffer struct {
// contains filtered or unexported fields
}
Provides weak-reference behavior to enable auto-stop of workers
func NewBackpressureBuffer ¶
func NewBackpressureBuffer(output io.Writer, bufSize int, maxParWrites uint8, flags BackpressureBufferFlags, missFn MissedEventFunc, ) *BackpressureBuffer
func NewBackpressureBufferWithBypass ¶
func NewBackpressureBufferWithBypass(output io.Writer, bufSize int, maxParWrites uint8, flags BackpressureBufferFlags, missFn MissedEventFunc, ) *BackpressureBuffer
func (BackpressureBuffer) Flush ¶
func (p BackpressureBuffer) Flush() error
NB! Flush() may NOT be able to clean up whole buffer when there are too many pending writers
func (BackpressureBuffer) GetAvgWriteDuration ¶
func (BackpressureBuffer) GetBareOutput ¶
func (BackpressureBuffer) IsLowLatencySupported ¶
func (p BackpressureBuffer) IsLowLatencySupported() bool
func (BackpressureBuffer) LogLevelWrite ¶
func (BackpressureBuffer) LowLatencyWrite ¶
func (BackpressureBuffer) SetAvgWriteDuration ¶
func (*BackpressureBuffer) StartWorker ¶
func (p *BackpressureBuffer) StartWorker(ctx context.Context) *BackpressureBuffer
The buffer requires a worker to scrap the buffer. Multiple workers are ok, but aren't necessary. Start of the worker will also attach a finalizer to the buffer.
type BackpressureBufferFlags ¶
type BackpressureBufferFlags uint8
const ( // Buffer content will not be flushed on fatal, instead a "missing X" message will be added. BufferDropOnFatal BackpressureBufferFlags = 1 << iota // Buffer may apply additional delay to writes done into a queue to equalize timings. // This mode requires either BufferTrackWriteDuration flag or use of SetAvgWriteDuration() externally. BufferWriteDelayFairness // With this flag the buffer will update GetAvgWriteDuration with every regular write. BufferTrackWriteDuration // When a worker is started, but all links to BackpressureBuffer were lost, then the worker will be stopped. // And with this flag present, the buffer (and its underlying output) will also be closed. BufferCloseOnStop // USE WITH CAUTION! This flag enables to use argument of Write([]byte) outside of the call. // This is AGAINST existing conventions and MUST ONLY be used when a writer's code is proprietary and never reuses the argument. BufferReuse )
type FatalDirectWriter ¶
type FatalDirectWriter struct {
// contains filtered or unexported fields
}
func NewFatalDirectWriter ¶
func NewFatalDirectWriter(output io.Writer) *FatalDirectWriter
func (*FatalDirectWriter) Close ¶
func (p *FatalDirectWriter) Close() error
func (*FatalDirectWriter) Flush ¶
func (p *FatalDirectWriter) Flush() error
func (*FatalDirectWriter) GetBareOutput ¶
func (p *FatalDirectWriter) GetBareOutput() io.Writer
func (*FatalDirectWriter) IsLowLatencySupported ¶
func (p *FatalDirectWriter) IsLowLatencySupported() bool
func (*FatalDirectWriter) LogLevelWrite ¶
func (*FatalDirectWriter) LowLatencyWrite ¶
type FatalHelper ¶
type FatalHelper struct {
// contains filtered or unexported fields
}
func (*FatalHelper) IsFatal ¶
func (p *FatalHelper) IsFatal() bool
func (*FatalHelper) LockFatal ¶
func (p *FatalHelper) LockFatal()
func (*FatalHelper) PostFatalWrite ¶
func (*FatalHelper) SetFatal ¶
func (p *FatalHelper) SetFatal() bool
type FlushBypass ¶
func NewFlushBypass ¶
func NewFlushBypass(output io.Writer) FlushBypass
func (*FlushBypass) Close ¶
func (p *FlushBypass) Close() error
func (*FlushBypass) ClosedError ¶
func (p *FlushBypass) ClosedError() error
func (*FlushBypass) DoClose ¶
func (p *FlushBypass) DoClose() (bool, error)
func (*FlushBypass) DoFlush ¶
func (p *FlushBypass) DoFlush() (bool, error)
func (*FlushBypass) DoFlushOrSync ¶
func (p *FlushBypass) DoFlushOrSync() (bool, error)
func (*FlushBypass) DoLevelWrite ¶
func (*FlushBypass) DoSync ¶
func (p *FlushBypass) DoSync() (bool, error)
func (*FlushBypass) Flush ¶
func (p *FlushBypass) Flush() error
func (*FlushBypass) FlushOrSync ¶
func (p *FlushBypass) FlushOrSync() error
func (*FlushBypass) IsClosed ¶
func (p *FlushBypass) IsClosed() bool
func (*FlushBypass) LogLevelWrite ¶
func (*FlushBypass) SetClosed ¶
func (p *FlushBypass) SetClosed() bool
func (*FlushBypass) Sync ¶
func (p *FlushBypass) Sync() error
type ProxyLoggerOutput ¶
type ProxyLoggerOutput struct {
// contains filtered or unexported fields
}
func (*ProxyLoggerOutput) Close ¶
func (p *ProxyLoggerOutput) Close() error
func (*ProxyLoggerOutput) Flush ¶
func (p *ProxyLoggerOutput) Flush() error
func (*ProxyLoggerOutput) GetBareOutput ¶
func (p *ProxyLoggerOutput) GetBareOutput() io.Writer
func (*ProxyLoggerOutput) GetTarget ¶
func (p *ProxyLoggerOutput) GetTarget() insolar.LoggerOutput
func (*ProxyLoggerOutput) IsLowLatencySupported ¶
func (p *ProxyLoggerOutput) IsLowLatencySupported() bool
func (*ProxyLoggerOutput) LogLevelWrite ¶
func (*ProxyLoggerOutput) LowLatencyWrite ¶
func (*ProxyLoggerOutput) SetTarget ¶
func (p *ProxyLoggerOutput) SetTarget(t insolar.LoggerOutput)
Click to show internal directories.
Click to hide internal directories.