Documentation ¶
Index ¶
- Constants
- func AddHandler(h Handler)
- func Cerr(msg string)
- func Exit(msgs ...interface{})
- func ExitIf(failure bool, msgs ...interface{})
- func ExitOn(err error, msgs ...interface{})
- func Info(msgs ...interface{})
- func PanicOnExit()
- func Set(cfg *cfg.Config)
- func SetErr(w io.Writer)
- func SetLogDir(dir string)
- func Warn(msgs ...interface{})
- func WarnIf(failure bool, msgs ...interface{})
- func WarnOn(err error, msgs ...interface{})
- type Flag
- type Handler
- type Level
- type Message
- type Meta
- type Multicaster
- type Throttle
Constants ¶
View Source
const MaxMulticastPerHour int = 100
MaxMulticastPerHour limits the number of messages sent to Multicast
View Source
const MaxSentryPerHour int = 100
MaxSentryPerHour limits the number of messages sent to Sentry
View Source
const MaxTextLength int = 128
MaxTextLength limits the length of text sent in the Text field of the emitted packet
Variables ¶
This section is empty.
Functions ¶
func AddHandler ¶
func AddHandler(h Handler)
AddHandler adds the supplied handler to the list of handlers
func PanicOnExit ¶
func PanicOnExit()
PanicOnExit will cause the alert package to call panic() instead of os.exit()
Types ¶
type Flag ¶
type Flag int
Flag ...
type Handler ¶
type Handler interface {
Handle(msg Message)
}
Handler is the interface for alert-handlers
type Message ¶
Message ...
type Multicaster ¶
type Multicaster struct {
// contains filtered or unexported fields
}
Multicaster provides functionality for emitting multicast messages
func NewMulticaster ¶
func NewMulticaster(ip string, port, ttl int) *Multicaster
NewMulticaster returns a new Multicaster object
func (*Multicaster) Emit ¶
func (m *Multicaster) Emit(message []byte)
Emit sends a message over multicast
func (*Multicaster) SetTTL ¶
func (m *Multicaster) SetTTL(amount int)
SetTTL sets the time to live for future packets
Click to show internal directories.
Click to hide internal directories.