varlog

package
v0.0.0-...-8ac0413 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package varlog contains http handler implementation for the varlog functionality.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(logCtx zerolog.Context, opener FileOpener) http.Handler

NewHandler creates a new http.Handler which conforms to the varlog API Spec.

Types

type FileOpener

type FileOpener interface {
	Open(filename string) (*stdos.File, error)
}

FileOpener defines the interface which is used to open file resources based on a single file name.

type LogParserHandler

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

LogParserHandler implements the v1 ServerInterface to open files and read lines from the end of it.

func NewLogParserHandler

func NewLogParserHandler(logCtx zerolog.Context, opener FileOpener) *LogParserHandler

NewLogParserHandler returns a new instance of the LogParserHandler.

func (*LogParserHandler) GetEntries

func (l *LogParserHandler) GetEntries(w http.ResponseWriter, r *http.Request, filename string, params v1.GetEntriesParams)

GetEntries uses the provided FileOpener implementation to retrieve the most recent log entries as part of the query parameters.

Jump to

Keyboard shortcuts

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