logstash

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

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

Go to latest
Published: Mar 12, 2019 License: Apache-2.0 Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

logstash-go-client

Minimal logstash golang client

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Fields    Fields
	Version   string
	Timestamp *time.Time
	// contains filtered or unexported fields
}

func (Entry) IsNil

func (e Entry) IsNil() bool

func (Entry) MarshalJSONObject

func (e Entry) MarshalJSONObject(enc *gojay.Encoder)

func (Entry) NKeys

func (e Entry) NKeys() int

func (Entry) UnmarshalJSONObject

func (e Entry) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

func (Entry) WithField

func (e Entry) WithField(name string, value interface{}) *Entry

func (Entry) WithFields

func (e Entry) WithFields(data map[string]interface{}) *Entry

func (Entry) WithTimeFormat

func (e Entry) WithTimeFormat(timeFormat string) *Entry

func (Entry) WithTimestamp

func (e Entry) WithTimestamp() *Entry

func (Entry) WithVersion

func (e Entry) WithVersion(version string) *Entry

type Fields

type Fields map[string]interface{}

func (Fields) IsNil

func (f Fields) IsNil() bool

func (Fields) MarshalJSONObject

func (f Fields) MarshalJSONObject(enc *gojay.Encoder)

func (Fields) NKeys

func (f Fields) NKeys() int

func (Fields) UnmarshalJSONObject

func (f Fields) UnmarshalJSONObject(dec *gojay.Decoder, k string) error

func (Fields) WithField

func (f Fields) WithField(name string, value interface{}) *Entry

func (Fields) WithFields

func (f Fields) WithFields(data map[string]interface{}) *Entry

func (Fields) WithTimeFormat

func (f Fields) WithTimeFormat(timeFormat string) *Entry

func (Fields) WithTimestamp

func (f Fields) WithTimestamp() *Entry

func (Fields) WithVersion

func (f Fields) WithVersion(version string) *Entry

type GojayJsonEncoder

type GojayJsonEncoder struct{}

func NewGojayJsonEncoder

func NewGojayJsonEncoder() *GojayJsonEncoder

func (GojayJsonEncoder) Marshal

func (g GojayJsonEncoder) Marshal(sendItem SendItem) ([]byte, error)

type HttpClient

type HttpClient struct {
	Host        string
	HttpClient  *http.Client
	JsonEncoder JsonEncoder
}

func NewHttpClient

func NewHttpClient(host string, httpClient *http.Client) *HttpClient

func (HttpClient) Send

func (c HttpClient) Send(sendingItem SendItem) error

func (HttpClient) SendBytes

func (c HttpClient) SendBytes(messageInBytes []byte) error

func (*HttpClient) SetJsonEncoder

func (c *HttpClient) SetJsonEncoder(encoder JsonEncoder)

type JsonEncoder

type JsonEncoder interface {
	Marshal(sendItem SendItem) ([]byte, error)
}

type SendItem

type SendItem interface {
	WithTimestamp() *Entry
	WithTimeFormat(timeFormat string) *Entry
	WithVersion(version string) *Entry
	WithField(name string, value interface{}) *Entry
	WithFields(data map[string]interface{}) *Entry
	MarshalJSONObject(enc *gojay.Encoder)
	IsNil() bool
}

type Sender

type Sender interface {
	Send(sendingItem SendItem) error
	SendBytes(messageInBytes []byte) error
}

Jump to

Keyboard shortcuts

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