gelf

package module
v0.0.0-...-7618155 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2017 License: Unlicense Imports: 8 Imported by: 0

README

gelf

Graylog client for Go.

Work in progress. JSON serialization is to be added yet.

Doesn't spam the memory allocator as much as this other graylog client for Go...

Documentation

Index

Constants

View Source
const (
	VERSION_1_1 = "1.1"
)

Variables

This section is empty.

Functions

func GetHost

func GetHost() string

func GetVersion

func GetVersion() string

func SendBytes

func SendBytes(packet []byte)

func SendEvent

func SendEvent(event Event)

func SendString

func SendString(packet string)

func Start

func Start(config Config) (err error)

Types

type BaseEvent

type BaseEvent struct {
	Version      string `json:"version"`
	Host         string `json:"host"`
	Facility     string `json:"facility",omitempty`
	ShortMessage string `json:"short_message"`
	FullMessage  string `json:"full_message,omitempty"`
}

func NewBaseEvent

func NewBaseEvent() BaseEvent

func (*BaseEvent) Init

func (e *BaseEvent) Init(shortMessage string)

func (*BaseEvent) InitWithFacility

func (e *BaseEvent) InitWithFacility(facility string, shortMessage string)

type Config

type Config struct {
	Enabled      bool   `json:"enabled"`
	Net          string `json:"net"`
	Addr         string `json:"addr"`
	Workers      int    `json:"workers"`
	Echo         bool   `json:"echo"`
	Host         string `json:"host"`
	Compress     bool   `json:"compress"`
	MaxChunkSize int    `json:"max_chunk_size"`
	BufSize      int    `json:"buf_size"`
}

type Event

type Event interface {
	ToJson() ([]byte, error)
}

Jump to

Keyboard shortcuts

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