outputs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2015 License: GPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const RotatorMaxFiles = 1000

Variables

This section is empty.

Functions

func LoadGeoIPData

func LoadGeoIPData()

func PrintPublishEvent

func PrintPublishEvent(event common.MapStr)

Types

type ElasticsearchOutputType

type ElasticsearchOutputType struct {
	OutputInterface
	Index          string
	TopologyExpire int

	TopologyMap map[string]string
}

func (*ElasticsearchOutputType) EnableTTL

func (out *ElasticsearchOutputType) EnableTTL() error

func (*ElasticsearchOutputType) GetNameByIP

func (out *ElasticsearchOutputType) GetNameByIP(ip string) string

func (*ElasticsearchOutputType) Init

func (out *ElasticsearchOutputType) Init(config config.MothershipConfig, topology_expire int) error

func (*ElasticsearchOutputType) PublishEvent

func (out *ElasticsearchOutputType) PublishEvent(ts time.Time, event common.MapStr) error

func (*ElasticsearchOutputType) PublishIPs

func (out *ElasticsearchOutputType) PublishIPs(name string, localAddrs []string) error

func (*ElasticsearchOutputType) UpdateLocalTopologyMap

func (out *ElasticsearchOutputType) UpdateLocalTopologyMap()

type FileOutputType

type FileOutputType struct {
	OutputInterface
	// contains filtered or unexported fields
}

func (*FileOutputType) Init

func (out *FileOutputType) Init(config config.MothershipConfig) error

func (*FileOutputType) PublishEvent

func (out *FileOutputType) PublishEvent(ts time.Time, event common.MapStr) error

func (*FileOutputType) PublishIPs

func (out *FileOutputType) PublishIPs(name string, localAddrs []string) error

func (*FileOutputType) UpdateLocalTopologyMap

func (out *FileOutputType) UpdateLocalTopologyMap()

type FileRotator

type FileRotator struct {
	Path             string
	Name             string
	RotateEveryBytes uint64
	KeepFiles        int
	// contains filtered or unexported fields
}

func (*FileRotator) CheckIfConfigSane

func (rotator *FileRotator) CheckIfConfigSane() error

func (*FileRotator) CreateDirectory

func (rotator *FileRotator) CreateDirectory() error

func (*FileRotator) FileExists

func (rotator *FileRotator) FileExists(file_no int) bool

func (*FileRotator) FilePath

func (rotator *FileRotator) FilePath(file_no int) string

func (*FileRotator) Rotate

func (rotator *FileRotator) Rotate() error

func (*FileRotator) WriteLine

func (rotator *FileRotator) WriteLine(line []byte) error

type OutputInterface

type OutputInterface interface {
	PublishIPs(name string, localAddrs []string) error
	GetNameByIP(ip string) string
	PublishEvent(ts time.Time, event common.MapStr) error
}

type PublishedTopology

type PublishedTopology struct {
	Name string
	IPs  string
}

type PublisherType

type PublisherType struct {
	Index               string
	Output              []OutputInterface
	TopologyOutput      OutputInterface
	ElasticsearchOutput ElasticsearchOutputType
	RedisOutput         RedisOutputType
	FileOutput          FileOutputType

	RefreshTopologyTimer <-chan time.Time
	Queue                chan common.MapStr
	// contains filtered or unexported fields
}
var Publisher PublisherType

func (*PublisherType) GetServerName

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

func (*PublisherType) Init

func (publisher *PublisherType) Init(publishDisabled bool) error

func (*PublisherType) PublishTopology

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

func (*PublisherType) UpdateTopologyPeriodically

func (publisher *PublisherType) UpdateTopologyPeriodically()

type RedisDataType

type RedisDataType uint16
const (
	RedisListType RedisDataType = iota
	RedisChannelType
)

type RedisOutputType

type RedisOutputType struct {
	OutputInterface
	Index string
	Conn  redis.Conn

	TopologyExpire    time.Duration
	ReconnectInterval time.Duration
	Hostname          string
	Password          string
	Db                int
	DbTopology        int
	Timeout           time.Duration
	DataType          RedisDataType
	FlushInterval     time.Duration

	TopologyMap map[string]string
	// contains filtered or unexported fields
}

func (*RedisOutputType) Close

func (out *RedisOutputType) Close()

func (*RedisOutputType) Connect

func (out *RedisOutputType) Connect() error

func (*RedisOutputType) GetNameByIP

func (out *RedisOutputType) GetNameByIP(ip string) string

func (*RedisOutputType) Init

func (out *RedisOutputType) Init(config config.MothershipConfig, topology_expire int) error

func (*RedisOutputType) PublishEvent

func (out *RedisOutputType) PublishEvent(ts time.Time, event common.MapStr) error

func (*RedisOutputType) PublishIPs

func (out *RedisOutputType) PublishIPs(name string, localAddrs []string) error

func (*RedisOutputType) Reconnect

func (out *RedisOutputType) Reconnect()

func (*RedisOutputType) RedisConnect

func (out *RedisOutputType) RedisConnect(db int) (redis.Conn, error)

func (*RedisOutputType) SendMessagesGoroutine

func (out *RedisOutputType) SendMessagesGoroutine()

func (*RedisOutputType) UpdateLocalTopologyMap

func (out *RedisOutputType) UpdateLocalTopologyMap(conn redis.Conn)

type RedisQueueMsg

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

type Topology

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

Jump to

Keyboard shortcuts

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