Versions in this module Expand all Collapse all v2 v2.0.5 Feb 25, 2020 v2.0.4 Feb 21, 2020 v2.0.3 Apr 19, 2019 Changes in this version + const RFC5424TimeStamp + var ErrBufferClose = errors.New("error in syslog5424 at buffer.Close()") + var ErrEmptyNetworkAddress = errors.New("Empty Network or Address") + var ErrImpossible = errors.New("NO ONE EXPECT THE RETURN OF SPANISH INQUISITION") + var ErrInvalidAddress = errors.New("Invalid Address") + var ErrInvalidNetwork = errors.New("Invalid Network") + var ErrNoConnecion = errors.New("No Connection established") + var ErrPos0 = errors.New("Pos 0 Found") + var ErrPosNotFound = errors.New("Pos Not Found") + var ErrTransportIncomplete = errors.New("Transport : Incomplete Message") + var ErrTransportInvHeader = errors.New("T_RFC5425 Split: invalid header len") + var ErrTransportNoHeader = errors.New("T_RFC5425 Split: no header len") + var Now = time.Now + func GenericSD(i sdata.SDIDLight) sdata.StructuredData + type Addr struct + func (a *Addr) Network() string + func (a *Addr) String() string + type Channel interface + AppName func(string) Channel + IsDevNull func() bool + Log func(string, ...sdata.StructuredData) + Logger func(string) *log.Logger + Msgid func(string) Channel + type Connector interface + Connect func() (WriteCloser, error) + func LocalConnector(network, address string) Connector + func StdioConnector(addr string) Connector + func TCPConnector(network, address string) Connector + type ConnectorFunc func() (WriteCloser, error) + func (f ConnectorFunc) Connect() (WriteCloser, error) + type DataReader interface + RemoteAddr func() net.Addr + type Dialer struct + FlushDelay time.Duration + func (d Dialer) Dial(network, address string, t Transport) (*Sender, <-chan error, error) + type InvalidConnector struct + func (ic InvalidConnector) Connect() (conn WriteCloser, err error) + type Listener interface + Accept func() (DataReader, error) + Close func() error + func GuessListener(network, address string) (Listener, error) + func TCPListener(network, address string) (Listener, error) + func UnixListener(address string) (Listener, error) + func UnixgramListener(address string) (Listener, error) + type Message struct + func CreateMessage(appname string, prio Priority, message string) Message + func CreateWholeMessage(prio Priority, ts time.Time, host, app, pid, msgid, message string) Message + func EmptyMessage() Message + func (msg Message) AppName(appname string) Message + func (msg Message) Delta(bootTs time.Time, strSec string, strNsec string) Message + func (msg Message) Epoch(strSec string, strNsec string) Message + func (msg Message) Host(host string) Message + func (msg Message) LocalHost() Message + func (msg Message) Marshal5424() ([]byte, error) + func (msg Message) Msg(message string) Message + func (msg Message) MsgID(msgid string) Message + func (msg Message) Now() Message + func (msg Message) Priority(prio Priority) Message + func (msg Message) ProcID(procid string) Message + func (msg Message) String() (s string) + func (msg Message) StructuredData(data ...sdata.StructuredData) Message + func (msg Message) Time(ts time.Time) Message + func (msg Message) Timestamp(stamp string) Message + type MessageImmutable struct + func Parse(data []byte, transport Transport, atEOF bool) (returnMsg MessageImmutable, rest []byte, mainErr error) + func (msg MessageImmutable) AppName() (app string) + func (msg MessageImmutable) Hostname() (host string) + func (msg MessageImmutable) MsgID() (msgid string) + func (msg MessageImmutable) Priority() (prio Priority) + func (msg MessageImmutable) ProcID() (procid string) + func (msg MessageImmutable) String() string + func (msg MessageImmutable) StructuredData() (lsd sdata.List) + func (msg MessageImmutable) Text() (text string) + func (msg MessageImmutable) TimeStamp() (ts time.Time) + func (msg MessageImmutable) Writable() Message + func (msg MessageImmutable) WriteTo(w io.Writer) (n int64, err error) + type ParseError struct + Buffer []byte + Message string + Pos int + func (pe ParseError) Error() string + type Priority int + const LogALERT + const LogAUTH + const LogAUTHPRIV + const LogCRIT + const LogCRON + const LogDAEMON + const LogDEBUG + const LogEMERG + const LogERR + const LogFTP + const LogINFO + const LogKERN + const LogLOCAL0 + const LogLOCAL1 + const LogLOCAL2 + const LogLOCAL3 + const LogLOCAL4 + const LogLOCAL5 + const LogLOCAL6 + const LogLOCAL7 + const LogLPR + const LogMAIL + const LogNEWS + const LogNOTICE + const LogSYSLOG + const LogUSER + const LogUUCP + const LogWARNING + func (p *Priority) Set(d string) error + func (p *Priority) Unmarshal5424(d []byte) error + func (p Priority) Facility() Priority + func (p Priority) Marshal5424() (data []byte, err error) + func (p Priority) Severity() Priority + func (p Priority) String() string + type Receiver struct + func NewReceiver(listener Listener, lenQueue int, t Transport) (*Receiver, <-chan error) + func (r *Receiver) End() + func (r *Receiver) Receive() (MessageImmutable, error, bool) + type Sender struct + func Dial(network, address string) (*Sender, <-chan error, error) + func NewSender(output Connector, transport Transport, ticker <-chan time.Time) (*Sender, <-chan error) + func (c *Sender) End() + func (c *Sender) Send(m Message) (err error) + type Syslog struct + func New(output *Sender, minPriority Priority, appname string) (syslog *Syslog, err error) + func (syslog *Syslog) Channel(sev Priority) Channel + func (syslog *Syslog) SubSyslog(subAppName string) (sub *Syslog) + func (syslog *Syslog) TestMode() + type Transport interface + Encode func([]byte) []byte + PrefixStrip func(buffer []byte, atEOF bool) (data, rest []byte, err error) + String func() string + SuffixStrip func(buffer []byte, atEOF bool) (data, rest []byte, err error) + var TransportLFEnded Transport = tLFEnded{} + var TransportRFC5425 Transport = tRFC5425{} + var TransportZeroEnded Transport = tZeroEnded{} + type WriteCloser interface