Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NopWriteCloser ¶ added in v0.0.5
func NopWriteCloser(w io.Writer) io.WriteCloser
NopWriteCloser nop closer for writer
Types ¶
type AsyncWriter ¶ added in v0.0.5
type AsyncWriter struct { // Writer 实际 writer,必填 Writer io.Writer // ChanSize 异步队列大小,可选 // 默认为 1024。当值为 -1 时,chanSize=0,即变为同步 ChanSize int // NeedStatus 是否需要 write 的状态 NeedStatus bool // contains filtered or unexported fields }
AsyncWriter 异步化的 writer
func (*AsyncWriter) LastWriteStatus ¶ added in v0.0.5
func (aw *AsyncWriter) LastWriteStatus() WriteStatus
LastWriteStatus 返回的是异步写的最新一次的状态
type MutexWriter ¶ added in v0.0.5
func NewMutexWriter ¶ added in v0.0.6
func NewMutexWriter(w io.Writer) *MutexWriter
NewMutexWriter wrap a writer with a mutex
func (*MutexWriter) WithLock ¶ added in v0.0.6
func (w *MutexWriter) WithLock(fn func(w io.Writer))
func (*MutexWriter) WithRLock ¶ added in v0.0.6
func (w *MutexWriter) WithRLock(fn func(w io.Writer))
type ResetWriter ¶
ResetWriter writer can reset
func NewResetWriter ¶
func NewResetWriter(w io.Writer) ResetWriter
NewResetWriter wrap writer to ResetWriter
type WriteStatus ¶ added in v0.0.5
WriteStatus status for Write
Click to show internal directories.
Click to hide internal directories.