msg

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageStyleGeneric = iota
	MessageStyleSuccess
	MessageStyleError
	MessageStyleInput
	MessageStyleOutput
	MessageStyleGroup
)

Variables

This section is empty.

Functions

func NewEvent

func NewEvent(value interface{}) *event

NewEvent creates a new event

func ReportError

func ReportError(err error) error

Types

type ErrorEvent

type ErrorEvent struct {
	Error string
}

ErrorEvent represents a Sleep

func NewErrorEvent

func NewErrorEvent(message string) *ErrorEvent

NewErrorEvent creates a new error event

func (*ErrorEvent) Messages

func (e *ErrorEvent) Messages() []*Message

Messages returns messages

type Event

type Event interface {
	Type() string
	Package() string
	Value() interface{}
	Timestamp() time.Time
	Init() Event
	SetLoggable(bool)
	IsLoggable() bool
}

Represents a generic event

func NewEventWithInit

func NewEventWithInit(value interface{}, init Event) Event

NewEvent creates a new event

type Events

type Events struct {
	Events []Event
	// contains filtered or unexported fields
}

Events represents events

func NewEvents

func NewEvents() *Events

NewEvents creates a new events

func (*Events) AsListener

func (e *Events) AsListener() Listener

AsListener returns a listener

type Listener

type Listener func(event Event)

Listener represents an event Listener

type Message

type Message struct {
	Header *Styled
	Tag    *Styled
	Items  []*Styled
}

Message represent en event message, that is handled by CLI or Web reporter.

func NewMessage

func NewMessage(header *Styled, tag *Styled, items ...*Styled) *Message

NewMessage creates a new tag message

type OutputEvent added in v0.34.1

type OutputEvent struct {
	Message string
	Tag     string
	Value   interface{}
}

func NewOutputEvent added in v0.34.1

func NewOutputEvent(message string, tag string, value interface{}) *OutputEvent

func (*OutputEvent) Messages added in v0.34.1

func (e *OutputEvent) Messages() []*Message

type Repeated

type Repeated struct {
	Spent time.Duration
	Count int
	Type  string
}

Repeated represents a repeated message

func (*Repeated) Reset added in v0.25.1

func (r *Repeated) Reset()

Reset reset count and spent time

type RepeatedEvent added in v0.29.0

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

RepeatedEvent represents a generic repeated message

func NewRepeatedEvent added in v0.29.0

func NewRepeatedEvent(message, tag string) *RepeatedEvent

NewSleepEvent create a new sleep event

func (*RepeatedEvent) Message added in v0.29.0

func (e *RepeatedEvent) Message(repeated *Repeated) *Message

type RepeatedReporter

type RepeatedReporter interface {
	//Returns messages
	Message(repeated *Repeated) *Message
}

RepeatedReporter represents a reporter that overrides current line (with \r)

type Reporter

type Reporter interface {
	//Returns zero or more  messages
	Messages() []*Message
}

Reporter represents a reporter that can report tag messages

type ResetError added in v0.40.0

type ResetError struct {
}

type RunnerInput

type RunnerInput interface {
	IsInput() bool
}

RunnerInput represent event storing runner input data, this interface enables matching runner in/out with failed validation (CLI)

type RunnerOutput

type RunnerOutput interface {
	IsOutput() bool
}

RunnerOutput represent event storing runner output data,this interface enables matching runner in/out with failed validation(CLI)

type SleepEvent

type SleepEvent struct {
	SleepTimeMs int
}

SleepEvent represents a Sleep

func NewSleepEvent

func NewSleepEvent(sleepTimeMs int) *SleepEvent

NewSleepEvent create a new sleep event

func (*SleepEvent) Message

func (e *SleepEvent) Message(repeated *Repeated) *Message

type StdoutEvent added in v0.34.1

type StdoutEvent struct {
	Info   string
	Stdout string
	Error  string
}

StdoutEvent represents an execution event end

func NewStdoutEvent added in v0.34.1

func NewStdoutEvent(info string, stdout string) *StdoutEvent

NewStdoutEvent crates a new execution start event value

func (*StdoutEvent) Messages added in v0.34.1

func (e *StdoutEvent) Messages() []*Message

Messages returns messages

type Styled

type Styled struct {
	Text  string
	Style int
}

Styled represent styled text

func NewStyled

func NewStyled(text string, style int) *Styled

NewStyled creates a new message

func (*Styled) Equals added in v0.25.1

func (s *Styled) Equals(styled *Styled) bool

Equals returns true if styled is equal

Jump to

Keyboard shortcuts

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