notify

package
v0.0.0-...-6aa7f09 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func System

func System(g *gorge.Context) error

System initializes notification system in gorge.

Types

type Context

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

Context notification context.

func FromContext

func FromContext(g *gorge.Context) *Context

FromContext returns a notify context from the given gorge context

func (*Context) Error

func (c *Context) Error(s string)

Error sends a error notification.

func (*Context) Errorf

func (c *Context) Errorf(f string, args ...any)

Errorf sames as error but accepts a fmt format string

func (*Context) Info

func (c *Context) Info(s string)

Info sends a info notification.

func (*Context) Infof

func (c *Context) Infof(f string, args ...any)

Infof sames as info but accepts a fmt format string

func (*Context) Warn

func (c *Context) Warn(s string)

Warn sends a warn notification.

func (*Context) Warnf

func (c *Context) Warnf(f string, args ...any)

Warnf sames as warn but accepts a fmt format string

type EventNotify

type EventNotify struct {
	Message  string
	Severity Severity
}

EventNotify the notification event to be triggered in gorge.

type Severity

type Severity int

Severity will affect the color of the notification.

const (
	SeverityInfo Severity = iota
	SeverityWarn
	SeverityError
)

Severity levels

Jump to

Keyboard shortcuts

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