kfkp

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 9 Imported by: 0

README

kfkp

A kafka producer pool for Go

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*poolInfo)

func WithAsync

func WithAsync(async bool) Option

func WithBrokerAddress

func WithBrokerAddress(brokerAddress string) Option

func WithInitCapacity

func WithInitCapacity(size int) Option

func WithMaxCapacity

func WithMaxCapacity(size int) Option

func WithMaxIdle

func WithMaxIdle(size int) Option

func WithRequiredAcks

func WithRequiredAcks(requiredAcks kafka.RequiredAcks) Option

func WithTopic

func WithTopic(topic string) Option

type Pool

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

func NewPool

func NewPool(opts ...Option) (*Pool, error)

func (*Pool) ClosePool

func (p *Pool) ClosePool() error

func (*Pool) GetConn

func (p *Pool) GetConn() (*producer, error)

func (*Pool) GetRunning

func (p *Pool) GetRunning() int

func (*Pool) PutConn

func (p *Pool) PutConn(pd *producer) error

type WaitQueue

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳