types

package
v0.0.0-...-06ab379 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectionTCP   = "tcp"
	ConnectionUDP   = "udp"
	ConnectionLOCAL = "local"
	ConnectionFILE  = "file"
	ConnectionNSQ   = "nsq"
)
View Source
const (
	TagStartUp  = "startup"
	TagConnect  = "connect"
	TagRoutine  = "routine"
	TagShutDown = "shutdown"
)
View Source
const (
	DelimiterV       = " | "
	DelimiterH       = " - "
	DelimiterA       = " * "
	DefaultDelimiter = DelimiterV
)
View Source
const (
	LogCallerSkipLevels = 3
)
View Source
const MaxConnectorQ = 4
View Source
const (
	SyncFileAfterMessagesCount = 100
)

Variables

View Source
var AvailableConnections = map[string]struct{}{
	ConnectionTCP:   {},
	ConnectionUDP:   {},
	ConnectionLOCAL: {},
	ConnectionFILE:  {},
	ConnectionNSQ:   {},
}
View Source
var DefaultReconnectionTime = time.Minute
View Source
var LogLevels = map[LogLevel]string{
	EMERG:  "EMERGENCY",
	ALERT:  "ALERT",
	CRIT:   "CRITICAL",
	ERR:    "ERROR",
	WARN:   "WARNING",
	NOTIFY: "NOTIFICATION",
	INFO:   "INFO",
	DEBUG:  "DEBUG",
}
View Source
var LogLevelsInv = map[string]LogLevel{
	"EMERGENCY":    EMERG,
	"ALERT":        ALERT,
	"CRITICAL":     CRIT,
	"ERROR":        ERR,
	"WARNING":      WARN,
	"NOTIFICATION": NOTIFY,
	"INFO":         INFO,
	"DEBUG":        DEBUG,
}

Functions

This section is empty.

Types

type LogLevel

type LogLevel int
const (
	EMERG LogLevel = iota
	ALERT
	CRIT
	ERR
	WARN
	NOTIFY
	INFO
	DEBUG
	FORCE // force one of levels above
)

type LogParams

type LogParams struct {
	IsForced     bool
	Level        LogLevel
	IsWithCaller bool
}

type LogWriter

type LogWriter interface {
	Emerg(m string) error
	Alert(m string) error
	Crit(m string) error
	Err(m string) error
	Warning(m string) error
	Notice(m string) error
	Info(m string) error
	Debug(m string) error
	Write([]byte) (int, error)
	Close() error
}

type MsgParams

type MsgParams struct {
	Delimiter string
	Tag       string
	Msg       string
}

type TimeParams

type TimeParams struct {
	Location *time.Location
	Format   string
}

type WriterStatus

type WriterStatus uint8
const (
	WriterStatusUndefined WriterStatus = iota
	WriterStatusOk
	WriterStatusStopped
)

Jump to

Keyboard shortcuts

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