endpoint

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

endpoint package implements the HTTP endpoints of Ayd.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleError

func HandleError(s *store.Store, scope string, err error)

func HealthzEndpoint

func HealthzEndpoint(s ErrorsGetter) http.HandlerFunc

HealthzEndpoint is the http.HandlerFunc for /healthz page. It receives ErrorsGetter interface instead of *store.Store because for make easier to test.

func LogCSVEndpoint

func LogCSVEndpoint(s *store.Store) http.HandlerFunc

func LogJsonEndpoint

func LogJsonEndpoint(s *store.Store) http.HandlerFunc

func LogTSVEndpoint

func LogTSVEndpoint(s *store.Store) http.HandlerFunc

func MetricsEndpoint

func MetricsEndpoint(s *store.Store) http.HandlerFunc

func New

func New(s *store.Store) http.Handler

func NewBasicAuth

func NewBasicAuth(handler http.Handler, userinfo string) http.Handler

func StatusHTMLEndpoint

func StatusHTMLEndpoint(s *store.Store) http.HandlerFunc

func StatusJSONEndpoint

func StatusJSONEndpoint(s *store.Store) http.HandlerFunc

func StatusTextEndpoint

func StatusTextEndpoint(s *store.Store) http.HandlerFunc

Types

type BasicAuth

type BasicAuth struct {
	Handler            http.Handler
	Username, Password string
}

func (BasicAuth) ServeHTTP

func (a BasicAuth) ServeHTTP(w http.ResponseWriter, r *http.Request)

type ErrorsGetter

type ErrorsGetter interface {
	Errors() (healthy bool, messages []string)
}

type LogFilter

type LogFilter struct {
	Scanner LogScanner
	Targets []string
}

func (LogFilter) Bytes

func (f LogFilter) Bytes() []byte

func (LogFilter) Close

func (f LogFilter) Close() error

func (LogFilter) Record

func (f LogFilter) Record() api.Record

func (LogFilter) Scan

func (f LogFilter) Scan() bool

type LogGenerator

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

func NewLogGenerator

func NewLogGenerator(s *store.Store, since, until time.Time) *LogGenerator

func (*LogGenerator) Bytes

func (g *LogGenerator) Bytes() []byte

func (*LogGenerator) Close

func (g *LogGenerator) Close() error

func (LogGenerator) Len

func (g LogGenerator) Len() int

func (LogGenerator) Less

func (g LogGenerator) Less(i, j int) bool

func (*LogGenerator) Record

func (g *LogGenerator) Record() api.Record

func (*LogGenerator) Scan

func (g *LogGenerator) Scan() bool

func (LogGenerator) Swap

func (g LogGenerator) Swap(i, j int)

type LogReader

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

func NewLogReader

func NewLogReader(path string, since, until time.Time) (*LogReader, error)

func NewLogReaderFromReader

func NewLogReaderFromReader(f io.ReadCloser, since, until time.Time) *LogReader

func (*LogReader) Bytes

func (r *LogReader) Bytes() []byte

func (*LogReader) Close

func (r *LogReader) Close() error

func (*LogReader) Record

func (r *LogReader) Record() api.Record

func (*LogReader) Scan

func (r *LogReader) Scan() bool

type LogScanner

type LogScanner interface {
	Close() error
	Scan() bool
	Bytes() []byte
	Record() api.Record
}

func NewLogScanner

func NewLogScanner(s *store.Store, since, until time.Time) (LogScanner, error)

Jump to

Keyboard shortcuts

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