message

package
v1.9.17 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ILineBreaker

type ILineBreaker interface {
	// Restore known linebreaks.
	Restore()

	// Detects (cross-OS) and removes any newline/line-break, at the end of the
	// content, ensuring text processing is done properly (e.g.: suffix).
	Strip()
}

ILineBreaker specifies what a LineBreaker does.

type IMessage

type IMessage interface {
	ILineBreaker
	ITag

	// String interface.
	String() string

	// GetComponentName returns the component name.
	GetComponentName() string

	// SetComponentName sets the component name.
	SetComponentName(name string) IMessage

	// GetContent returns the content.
	GetContent() content.IContent

	// SetContent sets the content.
	SetContent(c content.IContent) IMessage

	// SetContentBasedHashID sets a hash of the message's content.
	GetContentBasedHashID() string

	// GetContentBasedHashID returns the hash of the message's content.
	SetContentBasedHashID(hash string) IMessage

	// GetDebugEnvVarRegexeses returns the Debug env var regexes matchers.
	GetDebugEnvVarRegexes() *debug.Debug

	// SetDebugEnvVarRegexeses sets the Debug env var regexes matchers.
	SetDebugEnvVarRegexes(d *debug.Debug) *message

	// GetFields returns the structured fields.
	GetFields() fields.Fields

	// SetFields sets the structured fields.
	SetFields(fields fields.Fields) IMessage

	// GetFlag returns the flag.
	GetFlag() flag.Flag

	// SetFlag sets the flag.
	SetFlag(flag flag.Flag) IMessage

	// GetID returns the id.
	GetID() string

	// SetID sets the id.
	SetID(id string)

	// GetLevel returns the level.
	GetLevel() level.Level

	// SetLevel sets the level.
	SetLevel(l level.Level) IMessage

	// GetMessage (low-level) returns the message.
	GetMessage() *message

	// GetOutputName returns the name of the output in use.
	GetOutputName() string

	// SetOutputName sets the name of the output in use.
	SetOutputName(outputName string) IMessage

	// GetOutputsNames returns the outputs names that should be used.
	GetOutputsNames() []string

	// SetOutputsNames sets the outputs names that should be used.
	SetOutputsNames(outputsNames []string) IMessage

	// GetProcessorName returns the name of the processor in use.
	GetProcessorName() string

	// SetProcessorName sets the name of the processor in use.
	SetProcessorName(processorName string) IMessage

	// GetProcessorsNames returns the processors names that should be used.
	GetProcessorsNames() []string

	// SetProcessorsNames sets the processors names that should be used.
	SetProcessorsNames(processorsNames []string) IMessage

	// GetTimestamp returns the timestamp.
	GetTimestamp() time.Time

	// SetTimestamp sets the timestamp.
	SetTimestamp(timestamp time.Time) IMessage

	// IsEmpty returns true if the message is empty.
	IsEmpty() bool
	// contains filtered or unexported methods
}

IMessage specifies what a message does.

func Copy

func Copy(m IMessage) IMessage

Copy message.

Notes: - Changes in the `Message` or `Options` data structure may reflects here. Should reflect in the formatters too. - Could use something like the `Copier` package, but that's going to cause a data race, because `Output`s are processed concurrently.

TODO: This can be improved.

func New

func New(l level.Level, ct string) IMessage

New is the Message factory.

NOTE: Changes in the `Message` or `Options` data structure may reflects here.

type ITag

type ITag interface {
	// AddTags adds one or more tags.
	AddTags(tags ...string)

	// ContainTag verifies if tags contains the specified tag.
	ContainTag(tag string) bool

	// DeleteTag deletes a tag.
	DeleteTag(tag string)

	// GetTags retrieves tags.
	GetTags() []string
}

ITag specifies what a Tag does.

Jump to

Keyboard shortcuts

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