ingest

package
v0.0.0-...-22faead Latest Latest
Warning

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

Go to latest
Published: May 2, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EntBucketHeader    = "X-ent-bucket"
	EntOriginHeader    = "X-ent-origin"
	EntTimestampHeader = "X-ent-timestamp"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GelfConfig GelfConfig `yaml:"gelf"`
}

func GetDefaultConfig

func GetDefaultConfig() Config

type Entry

type Entry struct {
	Bucket    string
	Origin    string
	Type      string
	Timestamp int64
	Data      []byte
}

type GelfConfig

type GelfConfig struct {
	Address string `yaml:"address"`
}

type GelfMessage

type GelfMessage struct {
	Version      string
	Timestamp    float64
	Host         string
	ShortMessage string
	FullMessage  string
	Level        int
	Facility     string
	Additional   map[string]interface{}
}

func (*GelfMessage) GetBucket

func (gm *GelfMessage) GetBucket() string

func (*GelfMessage) GetTimestamp

func (gm *GelfMessage) GetTimestamp() int64

type GelfTcpInput

type GelfTcpInput struct {
	// contains filtered or unexported fields
}

func NewGelfTcpInput

func NewGelfTcpInput(config GelfConfig, processor Processor) (*GelfTcpInput, error)

func (*GelfTcpInput) Run

func (g *GelfTcpInput) Run(ctx context.Context, wg *sync.WaitGroup) error

type HttpInput

type HttpInput struct {
	// contains filtered or unexported fields
}

func NewHttpInput

func NewHttpInput(processor Processor) (*HttpInput, error)

func (*HttpInput) ServeHTTP

func (h *HttpInput) ServeHTTP(rsp http.ResponseWriter, rq *http.Request)

type Labels

type Labels map[string]string

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(config Config, processors []Processor) (*Manager, error)

func (*Manager) Process

func (m *Manager) Process(entry Entry) error

func (*Manager) Start

func (m *Manager) Start() (http.Handler, error)

func (*Manager) Stop

func (m *Manager) Stop() error

type Processor

type Processor interface {
	Process(entry Entry) error
}

Jump to

Keyboard shortcuts

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