kafkav1

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsumerOffsetNewest int64 = -1
	ConsumerOffsetOldest int64 = -2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KafkaBrokerV1

type KafkaBrokerV1 struct {
	sync.Once
	sync2.OnceError
	Logger    log.Logger
	URIs      []string
	TLS       *TLS
	Insecure  bool
	SubSarama *Sarama
	// contains filtered or unexported fields
}

KafkaBrokerV1

func (*KafkaBrokerV1) Connect

func (k *KafkaBrokerV1) Connect() error

func (*KafkaBrokerV1) Disconnect

func (k *KafkaBrokerV1) Disconnect() error

func (*KafkaBrokerV1) Marshal

func (k *KafkaBrokerV1) Marshal() string

func (*KafkaBrokerV1) Publish

func (k *KafkaBrokerV1) Publish(topic string, msg *broker.Message, opt ...broker.PublishOption) error

func (*KafkaBrokerV1) String

func (k *KafkaBrokerV1) String() string

func (*KafkaBrokerV1) Subscribe

func (k *KafkaBrokerV1) Subscribe(topics []string, callBack broker.CallBack, opt ...broker.SubscribeOption) (broker.Subscriber, error)

type Sarama

type Sarama struct {
	ConsumerOffsetsInitial int64
}

type TLS

type TLS struct {
	Insecure   bool
	CertFile   string // 公钥,需要转化为pem
	KeyFile    string // 私钥
	CaCertFile string // ca证书
}

Jump to

Keyboard shortcuts

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