flynn: github.com/flynn/flynn/pkg/syslog/rfc5424 Index | Files

package rfc5424

import "github.com/flynn/flynn/pkg/syslog/rfc5424"

Index

Package Files

message.go parser.go structured_data.go

type Header struct {
    Facility  int
    Severity  int
    Version   int
    Timestamp time.Time
    Hostname  []byte
    AppName   []byte
    ProcID    []byte
    MsgID     []byte
}

func (Header) Bytes Uses

func (h Header) Bytes() []byte

func (Header) PriVal Uses

func (h Header) PriVal() int

type Message Uses

type Message struct {
    Header
    StructuredData []byte
    Msg            []byte
}

func NewMessage Uses

func NewMessage(hdr *Header, msg []byte) *Message

NewMessage builds a new message from a copy of the header and message.

func Parse Uses

func Parse(buf []byte) (*Message, error)

Parse parses RFC5424 syslog messages into a Message.

func (Message) Bytes Uses

func (m Message) Bytes() []byte

func (Message) String Uses

func (m Message) String() string

type ParseError Uses

type ParseError struct {
    Cursor  int
    Message string
}

ParseError will be returned when Parse encounters an error.

func (*ParseError) Error Uses

func (p *ParseError) Error() string

type StructuredData Uses

type StructuredData struct {
    ID     []byte
    Params []StructuredDataParam
}

func ParseStructuredData Uses

func ParseStructuredData(buf []byte) (*StructuredData, error)

func (StructuredData) Encode Uses

func (e StructuredData) Encode(w io.Writer) error

func (StructuredData) String Uses

func (s StructuredData) String() string

type StructuredDataParam Uses

type StructuredDataParam struct {
    Name  []byte
    Value []byte
}

func (*StructuredDataParam) Encode Uses

func (s *StructuredDataParam) Encode(w io.Writer) error

func (StructuredDataParam) String Uses

func (s StructuredDataParam) String() string

Package rfc5424 imports 5 packages (graph) and is imported by 31 packages. Updated 2017-04-13. Refresh now. Tools for package owners.