Documentation ¶
Index ¶
- Constants
- Variables
- func HandleLogLine(conf *Config, l string)
- func NewLogsController(svc LogsService) *logsController
- func RequestIDMiddleware(next http.Handler) http.Handler
- func ResponseTimeMiddleware(next http.Handler) http.Handler
- func RunInBatches(ctx context.Context, batchSize, min, max int, ...) error
- type Color
- type Config
- type Error
- type LogsService
Constants ¶
View Source
const ( ErrNoRecords = Error("no_records") ErrClosed = Error("closed") )
Variables ¶
View Source
var ( Yellow = Color{ // contains filtered or unexported fields } Green = Color{ // contains filtered or unexported fields } Red = Color{ // contains filtered or unexported fields } Brown = Color{ // contains filtered or unexported fields } )
Functions ¶
func HandleLogLine ¶
func NewLogsController ¶
func NewLogsController(svc LogsService) *logsController
Types ¶
type Config ¶
type LogsService ¶
type LogsService interface { GetLogs(context.Context, int) ([]string, error) Shutdown(context.Context) error }
func NewLogsService ¶
func NewLogsService(file string) (LogsService, error)
NewLogsService returns an instance of LogsService. Should ideally call this with deferred LogsService.Shutdown to properly close resources.
Click to show internal directories.
Click to hide internal directories.