Documentation ¶
Index ¶
- func Close()
- func Rotate()
- type Option
- type RotateSyncer
- type RotateSyncerSet
- func (s *RotateSyncerSet) Delete(key RotateSyncer)
- func (s *RotateSyncerSet) Exist(key RotateSyncer) (ok bool)
- func (s *RotateSyncerSet) Len() int
- func (s *RotateSyncerSet) Range(f func(key RotateSyncer))
- func (s *RotateSyncerSet) SetNx(key RotateSyncer) bool
- func (s *RotateSyncerSet) Store(key RotateSyncer)
- type WriteSyncer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RotateSyncer ¶
type RotateSyncer interface { WriteSyncer SetOnClose(func()) Rotate() error }
RotateSyncer is a WriteSyncer interface with file rotate capability.
func NewLogWriter ¶
func NewLogWriter(FileName string, logDir string, options ...Option) (RotateSyncer, error)
NewLogWriter create a RotateSyncer writer for logging.Logger.
func NewRotater ¶
func NewRotater(filename string, options ...Option) (RotateSyncer, error)
NewRotater create a RotateSyncer writer.
type RotateSyncerSet ¶
type RotateSyncerSet struct {
// contains filtered or unexported fields
}
RotateSyncerSet is registry of RotateSyncer
func (*RotateSyncerSet) Delete ¶
func (s *RotateSyncerSet) Delete(key RotateSyncer)
Delete deletes the value for a key.
func (*RotateSyncerSet) Exist ¶
func (s *RotateSyncerSet) Exist(key RotateSyncer) (ok bool)
Exist returns whether value was found in the map.
func (*RotateSyncerSet) Range ¶
func (s *RotateSyncerSet) Range(f func(key RotateSyncer))
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
func (*RotateSyncerSet) SetNx ¶
func (s *RotateSyncerSet) SetNx(key RotateSyncer) bool
SetNx returns false value was found in the map. Otherwise, it stores and returns true.
func (*RotateSyncerSet) Store ¶
func (s *RotateSyncerSet) Store(key RotateSyncer)
Store sets the value for a key.
type WriteSyncer ¶
type WriteSyncer interface { io.WriteCloser Sync() error }
WriteSyncer is a WriteCloser interface with synchronize capability.
Click to show internal directories.
Click to hide internal directories.