publisher

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2016 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintPublishEvent

func PrintPublishEvent(event common.MapStr)

Types

type ChanClient

type ChanClient struct {
	Channel chan common.MapStr
}

ChanClient will forward all published events one by one to the given channel

func (ChanClient) PublishEvent

func (c ChanClient) PublishEvent(event common.MapStr, opts ...ClientOption) bool

PublishEvent will publish the event on the channel. Options will be ignored. Always returns true.

func (ChanClient) PublishEvents

func (c ChanClient) PublishEvents(events []common.MapStr, opts ...ClientOption) bool

PublishEvents publishes all event on the configured channel. Options will be ignored. Always returns true.

type Client

type Client interface {
	// PublishEvent publishes one event with given options. If Sync option is set,
	// PublishEvent will block until output plugins report success or failure state
	// being returned by this method.
	PublishEvent(event common.MapStr, opts ...ClientOption) bool

	// PublishEvents publishes multiple events with given options. If Guaranteed
	// option is set, PublishEvent will block until output plugins report
	// success or failure state being returned by this method.
	PublishEvents(events []common.MapStr, opts ...ClientOption) bool
}

Client is used by beats to publish new events.

type ClientOption

type ClientOption func(option Context) Context

ClientOption allows API users to set additional options when publishing events.

func Signal

func Signal(signaler outputs.Signaler) ClientOption

type Context

type Context struct {
	Signal outputs.Signaler
	// contains filtered or unexported fields
}

func Guaranteed

func Guaranteed(o Context) Context

Guaranteed option will retry publishing the event, until send attempt have been ACKed by output plugin.

func Sync

func Sync(o Context) Context

Sync option will block the event publisher until an event has been ACKed by the output plugin or failed.

type ExtChanClient

type ExtChanClient struct {
	Channel chan PublishMessage
}

func (ExtChanClient) PublishEvent

func (c ExtChanClient) PublishEvent(event common.MapStr, opts ...ClientOption) bool

PublishEvent will publish the event on the channel. Options will be ignored. Always returns true.

func (ExtChanClient) PublishEvents

func (c ExtChanClient) PublishEvents(events []common.MapStr, opts ...ClientOption) bool

PublishEvents publishes all event on the configured channel. Options will be ignored. Always returns true.

type PublishMessage

type PublishMessage struct {
	Context Context
	Events  []common.MapStr
}

type PublisherType

type PublisherType struct {
	IpAddrs []string

	Index          string
	Output         []*outputWorker
	TopologyOutput outputs.TopologyOutputer
	IgnoreOutgoing bool
	GeoLite        *libgeo.GeoIP

	RefreshTopologyTimer <-chan time.Time
	// contains filtered or unexported fields
}

func New

func New(
	beatName string,
	configs map[string]outputs.MothershipConfig,
	shipper ShipperConfig,
) (*PublisherType, error)

Create new PublisherType

func (*PublisherType) Client

func (publisher *PublisherType) Client() Client

func (*PublisherType) GetServerName

func (publisher *PublisherType) GetServerName(ip string) string

func (*PublisherType) IsPublisherIP

func (publisher *PublisherType) IsPublisherIP(ip string) bool

func (*PublisherType) PublishTopology

func (publisher *PublisherType) PublishTopology(params ...string) error

func (*PublisherType) UpdateTopologyPeriodically

func (publisher *PublisherType) UpdateTopologyPeriodically()

type ShipperConfig

type ShipperConfig struct {
	Name                  string
	Refresh_topology_freq int
	Ignore_outgoing       bool
	Topology_expire       int
	Tags                  []string
	Geoip                 common.Geoip

	// internal publisher queue sizes
	QueueSize     *int `yaml:"queue_size"`
	BulkQueueSize *int `yaml:"bulk_queue_size"`
}

type Topology

type Topology struct {
	Name string `json:"name"`
	Ip   string `json:"ip"`
}

type TransactionalEventPublisher

type TransactionalEventPublisher interface {
	PublishTransaction(transaction outputs.Signaler, events []common.MapStr)
}

Jump to

Keyboard shortcuts

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