rotater

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2022 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close()

Close will close all registered logger .

func Rotate

func Rotate()

Rotate will rotate all registered logger .

Types

type Option

type Option = rotatelogs.Option

Option is an alias for the rotatelogs.Option

type RotateSyncer

type RotateSyncer interface {
	WriteSyncer
	SetOnClose(func())
	Rotate() error
}

RotateSyncer is a WriteSyncer interface with file rotate capability.

func NewLocked

func NewLocked(ws WriteSyncer) RotateSyncer

NewLocked create a writer.

func NewLogWriter

func NewLogWriter(FileName string, logDir string, options ...Option) (RotateSyncer, error)

NewLogWriter create a RotateSyncer writer for logging.Logger.

func NewNull

func NewNull() RotateSyncer

NewNull create a blackhole writer.

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) Len

func (s *RotateSyncerSet) Len() int

Len returns sizeof 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.

Jump to

Keyboard shortcuts

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