Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

rotater

v1.0.0
amuz.es/src/go/logging/rotater

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

18 matches

Top ↑

Functions

Close

func Close()

Close will close all registered logger .

Rotate

func Rotate()

Rotate will rotate all registered logger .

Types

Option

type Option = rotatelogs.Option

Option is an alias for the rotatelogs.Option

RotateSyncer

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

RotateSyncer is a WriteSyncer interface with file rotate capability.

NewLocked

func NewLocked(ws WriteSyncer) RotateSyncer

NewLocked create a writer.

NewLogWriter

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

NewLogWriter create a RotateSyncer writer for logging.Logger.

NewNull

func NewNull() RotateSyncer

NewNull create a blackhole writer.

NewRotater

func NewRotater(filename string, options ...Option) (RotateSyncer, error)

NewRotater create a RotateSyncer writer.

RotateSyncerSet

type RotateSyncerSet struct {
	// contains filtered or unexported fields
}

RotateSyncerSet is registry of RotateSyncer

RotateSyncerSet.Delete

func (s *RotateSyncerSet) Delete(key RotateSyncer)

Delete deletes the value for a key.

RotateSyncerSet.Exist

func (s *RotateSyncerSet) Exist(key RotateSyncer) (ok bool)

Exist returns whether value was found in the map.

RotateSyncerSet.Len

func (s *RotateSyncerSet) Len() int

Len returns sizeof the map.

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.

RotateSyncerSet.SetNx

func (s *RotateSyncerSet) SetNx(key RotateSyncer) bool

SetNx returns false value was found in the map. Otherwise, it stores and returns true.

RotateSyncerSet.Store

func (s *RotateSyncerSet) Store(key RotateSyncer)

Store sets the value for a key.

WriteSyncer

type WriteSyncer interface {
	io.WriteCloser
	Sync() error
}

WriteSyncer is a WriteCloser interface with synchronize capability.

Dependency graph