sawmill

package
v0.0.25 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SawmillStaticFSDir = files.NewSubdirectoryFS(staticFS, "embeds/static")
View Source
var SawmillTemplateFS = files.NewSubdirectoryFS(staticFS, "embeds/templates")

Functions

This section is empty.

Types

type FSLineTracker added in v0.0.20

type FSLineTracker struct {
	FS   fs.FS
	Path string

	Content       []string
	LastWriteTime time.Time
	// contains filtered or unexported fields
}

func NewFSLineTracker added in v0.0.20

func NewFSLineTracker(fs fs.FS, filepath string) *FSLineTracker

func (*FSLineTracker) Refresh added in v0.0.20

func (f *FSLineTracker) Refresh() error

type LogLine

type LogLine struct {
	Time    string
	Level   string
	Message string
	Source  string
	Object  map[string]any
}

type SawmillServer

type SawmillServer struct {
	TmplFS   fs.FS
	StaticFS fs.FS
	LogsFS   fs.FS

	Trackers map[string]*FSLineTracker

	SelectedFiles []string
	Query         string
	CurrentLines  []string

	Log *slog.Logger
}

func NewSawmillServer

func NewSawmillServer(logPath string, tmplFS, staticFS fs.FS, log *slog.Logger) *SawmillServer

func (*SawmillServer) Events

func (s *SawmillServer) Events() []LogLine

func (*SawmillServer) ExecuteQuery

func (s *SawmillServer) ExecuteQuery(query string) error

func (*SawmillServer) Paths

func (s *SawmillServer) Paths() []string

func (*SawmillServer) RegisterRoutes

func (s *SawmillServer) RegisterRoutes(r *mux.Router)

func (*SawmillServer) UpdateSelection

func (s *SawmillServer) UpdateSelection(selected []string) error

Jump to

Keyboard shortcuts

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