kafka

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConsumer

func NewConsumer(clientId ClientID, Cfg config.Config) (sarama.Consumer, error)

Types

type ClientID

type ClientID string
const (
	ACTION_CLIENTID   ClientID = "k8guard-action-kafka-client"
	DISCOVER_CLIENTID ClientID = "k8guard-discover-kafka-client"

	// Event consumer feature will be implemented in the future.
	EVENT_CONSUMER_CLIENTID ClientID = "k8guard-event-consumer-kafka-client"
	EVENT_PARSER_CLIENTID   ClientID = "k8guard-event-parser-kafka-client"
)

type KafkaProducer

type KafkaProducer interface {
	SendMessage(topic string, bytes []byte) error
	SendData(topic string, kind MessageType, message interface{}) error
	Close()
}

func NewProducer

func NewProducer(clientId ClientID, Cfg config.Config) (KafkaProducer, error)

type MessageType

type MessageType string
const (
	NAMESPACE_MESSAGE  MessageType = "namespace"
	POD_MESSAGE        MessageType = "pod"
	DEPLOYMENT_MESSAGE MessageType = "deployment"
	INGRESS_MESSAGE    MessageType = "ingress"
	JOB_MESSAGE        MessageType = "job"
	CRONJOB_MESSAGE    MessageType = "cronjob"
	// To be used to see if kafka topic is there.
	TEST_MESSAGE MessageType = "test"
)

Jump to

Keyboard shortcuts

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