istio: Index | Files

package diag

import ""


Package Files

level.go message.go messages.go


var (
    // Info level is for informational messages
    Info = Level{2, "Info"}

    // Warning level is for warning messages
    Warning = Level{1, "Warn"}

    // Error level is for error messages
    Error = Level{0, "Error"}

type Level Uses

type Level struct {
    // contains filtered or unexported fields

Level is the severity level of a message.

func (Level) String Uses

func (l Level) String() string

type Message Uses

type Message struct {
    Type *MessageType

    // The Parameters to the message
    Parameters []interface{}

    // Origin of the message
    Origin resource.Origin

Message is a specific diagnostic message

func NewMessage Uses

func NewMessage(mt *MessageType, o resource.Origin, p ...interface{}) Message

NewMessage returns a new Message instance from an existing type.

func (*Message) String Uses

func (m *Message) String() string

String implements io.Stringer

func (*Message) Unstructured Uses

func (m *Message) Unstructured(includeOrigin bool) map[string]interface{}

Unstructured returns this message as a JSON-style unstructured map

type MessageType Uses

type MessageType struct {
    // contains filtered or unexported fields

MessageType is a type of diagnostic message

func NewMessageType Uses

func NewMessageType(level Level, code, template string) *MessageType

NewMessageType returns a new MessageType instance.

func (*MessageType) Code Uses

func (m *MessageType) Code() string

Code returns the code of the MessageType

func (*MessageType) Level Uses

func (m *MessageType) Level() Level

Level returns the level of the MessageType

func (*MessageType) Template Uses

func (m *MessageType) Template() string

Template returns the message template used by the MessageType

type Messages Uses

type Messages []Message

Messages is a slice of Message items.

func (*Messages) Add Uses

func (ms *Messages) Add(m Message)

Add a new message to the messages

func (*Messages) Sort Uses

func (ms *Messages) Sort()

Sort the message lexicographically by level, code, origin, then string.

func (*Messages) SortedCopy Uses

func (ms *Messages) SortedCopy() Messages

Return a different sorted Messages struct

Package diag imports 3 packages (graph) and is imported by 6 packages. Updated 2019-10-20. Refresh now. Tools for package owners.