Documentation ¶
Overview ¶
Graylog2 GELF client
Index ¶
- Constants
- Variables
- type CompressionType
- type GelfClient
- type GelfProtocolClient
- type Message
- type MessageData
- type MessageId
- type TcpClient
- type TcpConnMng
- func (tcpConnMng *TcpConnMng) Close() error
- func (tcpConnMng *TcpConnMng) LocalAddr() net.Addr
- func (tcpConnMng *TcpConnMng) Read(b []byte) (n int, err error)
- func (tcpConnMng *TcpConnMng) RemoteAddr() net.Addr
- func (tcpConnMng *TcpConnMng) SetDeadline(t time.Time) error
- func (tcpConnMng *TcpConnMng) SetReadDeadline(t time.Time) error
- func (tcpConnMng *TcpConnMng) SetWriteDeadline(t time.Time) error
- func (tcpConnMng *TcpConnMng) Write(b []byte) (n int, err error)
- type UdpClient
Constants ¶
View Source
const ( UDP_NETWORK = "udp" MESSAGE_ID_SIZE = 8 )
View Source
const (
GELF_VERSION = "1.2"
)
View Source
const TCP_NETWORK = "tcp"
Variables ¶
View Source
var ( CHUNCK_MAGIC_DATA = []byte{0x1e, 0x0f} HEADER_SIZE = len(CHUNCK_MAGIC_DATA) + MESSAGE_ID_SIZE + sequenceInfoSize )
View Source
var GZIP_MAGIC_PREFIX = []byte{0x1F, 0x8B}
View Source
var MESSAGE_SEPARATOR = []byte{0}
View Source
var (
UNSUPPORTED_COMPRESSION_TYPE = fmt.Errorf("Unsupported compression type")
)
Functions ¶
This section is empty.
Types ¶
type CompressionType ¶
type CompressionType string
const ( COMPRESSION_NONE CompressionType = "none" COMPRESSION_GZIP CompressionType = "gzip" )
type GelfClient ¶
type GelfClient struct { GelfProtocolClient CompressionType CompressionLevel int }
func NewGelfClient ¶
func NewGelfClient(gelfProtocolClient GelfProtocolClient, compressionType CompressionType) *GelfClient
func (*GelfClient) SendMessage ¶
func (gelfClient *GelfClient) SendMessage(message interface{}) error
type GelfProtocolClient ¶
type GelfProtocolClient interface {
SendMessageData(messageData MessageData) error
}
type Message ¶
type Message struct { Version string `json:"version"` Host string `json:"host"` ShortMessage string `json:"short_message"` Timestamp float64 `json:"timestamp"` Level l.Level `json:"level"` FullMessage string `json:"full_message,omitempty"` Facility string `json:"facility,omitempty"` Line uint `json:"line,omitempty"` File string `json:"file,omitempty"` }
type MessageData ¶
type MessageData []byte
type TcpClient ¶
func MustTcpClient ¶
func (*TcpClient) SendMessageData ¶
func (tcpClient *TcpClient) SendMessageData(message MessageData) error
type TcpConnMng ¶
func DialTcpMng ¶
func DialTcpMng(net string, laddr, raddr *net.TCPAddr) (*TcpConnMng, error)
func (*TcpConnMng) Close ¶
func (tcpConnMng *TcpConnMng) Close() error
func (*TcpConnMng) LocalAddr ¶
func (tcpConnMng *TcpConnMng) LocalAddr() net.Addr
func (*TcpConnMng) RemoteAddr ¶
func (tcpConnMng *TcpConnMng) RemoteAddr() net.Addr
func (*TcpConnMng) SetDeadline ¶
func (tcpConnMng *TcpConnMng) SetDeadline(t time.Time) error
func (*TcpConnMng) SetReadDeadline ¶
func (tcpConnMng *TcpConnMng) SetReadDeadline(t time.Time) error
func (*TcpConnMng) SetWriteDeadline ¶
func (tcpConnMng *TcpConnMng) SetWriteDeadline(t time.Time) error
type UdpClient ¶
func (*UdpClient) SendMessageData ¶
func (udpClient *UdpClient) SendMessageData(messageData MessageData) error
Click to show internal directories.
Click to hide internal directories.