logwriter

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlreadyExists = errors.New("already exists")
View Source
var ErrBadName = errors.New("bad name")
View Source
var ErrFileNotFound = errors.New("file not found")
View Source
var ErrNotFound = errors.New("entry not found")

Functions

This section is empty.

Types

type LiveLog

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

func NewLiveLogger

func NewLiveLogger(dir string) (*LiveLog, error)

func (*LiveLog) IsAlive

func (t *LiveLog) IsAlive(id string) bool

func (*LiveLog) ListIDs

func (t *LiveLog) ListIDs() []string

func (*LiveLog) NewWriter

func (t *LiveLog) NewWriter(id string) (*LiveLogWriter, error)

func (*LiveLog) Remove

func (t *LiveLog) Remove(id string) error

func (*LiveLog) Subscribe

func (t *LiveLog) Subscribe(id string) (chan []byte, error)

func (*LiveLog) Unsubscribe

func (t *LiveLog) Unsubscribe(id string, ch chan []byte)

type LiveLogWriter

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

func (*LiveLogWriter) Close

func (t *LiveLogWriter) Close() error

func (*LiveLogWriter) Write

func (t *LiveLogWriter) Write(data []byte) (int, error)

type LogManager

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

func NewLogManager

func NewLogManager(dir string, maxLogFiles int) (*LogManager, error)

func (*LogManager) Finalize

func (lm *LogManager) Finalize(id string) (frozenID string, err error)

func (*LogManager) LiveLogIDs

func (lm *LogManager) LiveLogIDs() []string

LiveLogIDs returns the list of IDs of live logs e.g. with writes in progress.

func (*LogManager) NewLiveWriter

func (lm *LogManager) NewLiveWriter(idbase string) (string, io.WriteCloser, error)

NewLiveWriter creates a new live log writer. The ID is the base name of the log file, a transformed ID is returned.

func (*LogManager) Subscribe

func (lm *LogManager) Subscribe(id string) (chan []byte, error)

func (*LogManager) Unsubscribe

func (lm *LogManager) Unsubscribe(id string, ch chan []byte)

type RotatingLog

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

func NewRotatingLog

func NewRotatingLog(dir string, maxLogFiles int) *RotatingLog

func (*RotatingLog) Read

func (r *RotatingLog) Read(name string) ([]byte, error)

func (*RotatingLog) Write

func (r *RotatingLog) Write(data []byte) (string, error)

Jump to

Keyboard shortcuts

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