output

package
v0.0.0-...-286a573 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const BackgroundOffset = 31
View Source
const TimeFormat = "15:04:05"

Variables

This section is empty.

Functions

func FromTemplate

func FromTemplate(log *Logger, tmpl string, ob interface{}) string

Types

type Data

type Data map[string]string

type LineBreaker

type LineBreaker struct {
	Output chan Message
	ID     string
	// contains filtered or unexported fields
}

func NewLineBreaker

func NewLineBreaker(out chan Message, ID string, t MessageType) *LineBreaker

func (*LineBreaker) Write

func (w *LineBreaker) Write(p []byte) (int, error)

type Logger

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

func NewLogger

func NewLogger(debug bool, opts ...LoggerOption) *Logger

func (*Logger) Debugf

func (l *Logger) Debugf(s string, args ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(s string, args ...interface{})

func (*Logger) Printf

func (l *Logger) Printf(s string, args ...interface{})

type LoggerOption

type LoggerOption = func(*Logger)

func WithOut

func WithOut(out io.Writer) LoggerOption

type Message

type Message struct {
	// ID is the message sender
	ID string
	// Type of message
	Type MessageType
	// Content of the message
	Content string
}

Message are how processes communicate

type MessageType

type MessageType int
const (
	Log MessageType = iota
	Error
	Stop
	Restart
	PodConnection
	Memory
	CPU
)

type StructuredLog

type StructuredLog struct {
	Level     string
	Timestamp string
	Parsed    string
}

func ParseToStructured

func ParseToStructured(l string) StructuredLog

type Style

type Style = []interface{}

type Styler

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

func (*Styler) Next

func (s *Styler) Next() Style

Jump to

Keyboard shortcuts

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