syslog

package
v0.0.0-...-dc1aa59 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2016 License: Apache-2.0 Imports: 29 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TransformNone = "none"
	TransformAvro = "avro"
)

Variables

View Source
var Config *config = &config{
	FrameworkName: "syslog-kafka",
	FrameworkRole: "*",
	Cpus:          0.1,
	Mem:           64,
	NumProducers:  1,
	ChannelSize:   10000,
	TcpPort:       "auto",
	UdpPort:       "auto",
	Transform:     "none",
	LogLevel:      "info",
}

Functions

func InitLogging

func InitLogging(level string) error

Types

type ApiRequest

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

func NewApiRequest

func NewApiRequest(url string) *ApiRequest

func (*ApiRequest) Get

func (r *ApiRequest) Get() *ApiResponse

func (*ApiRequest) PutBool

func (r *ApiRequest) PutBool(key string, value bool)

func (*ApiRequest) PutFloat

func (r *ApiRequest) PutFloat(key string, value float64)

func (*ApiRequest) PutInt

func (r *ApiRequest) PutInt(key string, value int64)

func (*ApiRequest) PutString

func (r *ApiRequest) PutString(key string, value interface{})

func (*ApiRequest) PutStringSlice

func (r *ApiRequest) PutStringSlice(key string, value []string)

type ApiResponse

type ApiResponse struct {
	Success bool
	Message string
}

func NewApiResponse

func NewApiResponse(success bool, message string) *ApiResponse

type Cluster

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

func NewCluster

func NewCluster() *Cluster

func (*Cluster) Add

func (c *Cluster) Add(slave string, task *mesos.TaskInfo)

func (*Cluster) Exists

func (c *Cluster) Exists(slave string) bool

func (*Cluster) GetAllTasks

func (c *Cluster) GetAllTasks() []*mesos.TaskInfo

func (*Cluster) Remove

func (c *Cluster) Remove(slave string)

type Executor

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

func NewExecutor

func NewExecutor(tcpPort int, udpPort int, hostname string) *Executor

func (*Executor) Disconnected

func (e *Executor) Disconnected(executor.ExecutorDriver)

func (*Executor) Error

func (e *Executor) Error(driver executor.ExecutorDriver, message string)

func (*Executor) FrameworkMessage

func (e *Executor) FrameworkMessage(driver executor.ExecutorDriver, message string)

func (*Executor) KillTask

func (e *Executor) KillTask(driver executor.ExecutorDriver, id *mesos.TaskID)

func (*Executor) LaunchTask

func (e *Executor) LaunchTask(driver executor.ExecutorDriver, task *mesos.TaskInfo)

func (*Executor) Registered

func (e *Executor) Registered(driver executor.ExecutorDriver, executor *mesos.ExecutorInfo, framework *mesos.FrameworkInfo, slave *mesos.SlaveInfo)

func (*Executor) Reregistered

func (e *Executor) Reregistered(driver executor.ExecutorDriver, slave *mesos.SlaveInfo)

func (*Executor) Shutdown

func (e *Executor) Shutdown(driver executor.ExecutorDriver)

type HttpServer

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

func NewHttpServer

func NewHttpServer(address string) *HttpServer

func (*HttpServer) Start

func (hs *HttpServer) Start()

type Scheduler

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

func (*Scheduler) Disconnected

func (s *Scheduler) Disconnected(scheduler.SchedulerDriver)

func (*Scheduler) Error

func (s *Scheduler) Error(driver scheduler.SchedulerDriver, message string)

func (*Scheduler) ExecutorLost

func (s *Scheduler) ExecutorLost(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, slave *mesos.SlaveID, status int)

func (*Scheduler) FrameworkMessage

func (s *Scheduler) FrameworkMessage(driver scheduler.SchedulerDriver, executor *mesos.ExecutorID, slave *mesos.SlaveID, message string)

func (*Scheduler) OfferRescinded

func (s *Scheduler) OfferRescinded(driver scheduler.SchedulerDriver, id *mesos.OfferID)

func (*Scheduler) Registered

func (s *Scheduler) Registered(driver scheduler.SchedulerDriver, id *mesos.FrameworkID, master *mesos.MasterInfo)

func (*Scheduler) Reregistered

func (s *Scheduler) Reregistered(driver scheduler.SchedulerDriver, master *mesos.MasterInfo)

func (*Scheduler) ResourceOffers

func (s *Scheduler) ResourceOffers(driver scheduler.SchedulerDriver, offers []*mesos.Offer)

func (*Scheduler) SetActive

func (s *Scheduler) SetActive(active bool)

func (*Scheduler) Shutdown

func (s *Scheduler) Shutdown(driver *scheduler.MesosSchedulerDriver)

func (*Scheduler) SlaveLost

func (s *Scheduler) SlaveLost(driver scheduler.SchedulerDriver, slave *mesos.SlaveID)

func (*Scheduler) Start

func (s *Scheduler) Start() error

func (*Scheduler) StatusUpdate

func (s *Scheduler) StatusUpdate(driver scheduler.SchedulerDriver, status *mesos.TaskStatus)

type SyslogMessage

type SyslogMessage struct {
	Message   string
	Hostname  string
	Timestamp int64
}

type SyslogProducer

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

func NewSyslogProducer

func NewSyslogProducer(config *SyslogProducerConfig) *SyslogProducer

func (*SyslogProducer) Start

func (this *SyslogProducer) Start()

func (*SyslogProducer) Stop

func (this *SyslogProducer) Stop()

func (*SyslogProducer) String

func (this *SyslogProducer) String() string

type SyslogProducerConfig

type SyslogProducerConfig struct {
	// Syslog producer config.
	ProducerConfig *producer.ProducerConfig

	// Number of producer instances.
	NumProducers int

	Topic string

	// Receive messages from this TCP address and post them to topic.
	TCPAddr string

	// Receive messages from this UDP address and post them to topic.
	UDPAddr string

	// Kafka Broker List host:port,host:port
	BrokerList string

	// Hostname the message came from
	Hostname string

	Namespace string

	// Transformer func(message syslogparser.LogParts, topic string) *sarama.ProducerMessage
	Transformer func(message *SyslogMessage, topic string) *producer.ProducerRecord

	ValueSerializer producer.Serializer
}

SyslogProducerConfig defines configuration options for SyslogProducer

func NewSyslogProducerConfig

func NewSyslogProducerConfig() *SyslogProducerConfig

Creates an empty SyslogProducerConfig.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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