log_sub

package
v0.0.0-...-9fceb56 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Location          *SeekInfo // if nil it will consumer log from cur time
	DateTimeLogLayout *DateTimeLayout

	Logger mylog.Logger
}

type Consumer

type Consumer struct {
	Lines chan *Line
	Config
	// contains filtered or unexported fields
}

func NewConsumer

func NewConsumer(config Config) (*Consumer, error)

func (*Consumer) Close

func (c *Consumer) Close()

func (*Consumer) Tell

func (c *Consumer) Tell() (*SeekInfo, error)

type DateTimeLayout

type DateTimeLayout struct {
	FilePath string // e.g. /path/to/20230815.log
	Layout   string // e.g. 20060102.log
}

func (*DateTimeLayout) FormatFile

func (dt *DateTimeLayout) FormatFile(t time.Time) string

type Line

type Line struct {
	Text string
	Err  error
	Meta LineMeta
}

type LineMeta

type LineMeta struct {
	FileName string
}

type SeekInfo

type SeekInfo struct {
	FileName string
	Offset   int64
	Whence   int
}

Jump to

Keyboard shortcuts

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