connection

package
v0.0.0-...-f374617 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LastOffset  int64 = -1
	FirstOffset int64 = -2
)

Variables

View Source
var (
	ConnectEtcd *clientv3.Client
)
View Source
var (
	KafkaConn *kafka.Conn
)

Functions

func Configure

func Configure(kafkaBrokerUrls []string, clientId string, topic string) (w *kafka.Writer, err error)

func ConnKafka

func ConnKafka() (err error)

func CreateKafkaTopic

func CreateKafkaTopic(topicName string, numPartitions int, replicationFactor int, retentionTime string) (err error)

CreateKafkaTopicIfNotExist will create kafka topic if not exist If Topic exist Already it will not effect existing one

func EtcdConnect

func EtcdConnect() (*clientv3.Client, error)

connect to etcd

func GetKafkaReader

func GetKafkaReader(topic, consumerGroupName string, offsetMode int64) *kafka.Reader

GetKafkaReader reader object for consumption

func NewConnection

func NewConnection(url string, opts ...nats.Option) (*nats.Conn, error)

NewConnection nats connection

func SetupConnOptions

func SetupConnOptions(opts []nats.Option) []nats.Option

SetupConnOptions setup connection options

Types

This section is empty.

Jump to

Keyboard shortcuts

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