core

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader is an abstraction object on top of kakfa.Reader it holds the creation config as attribute and a pointer to the reader itself it implements RefreshableInterface so that can be used by AutoRefreshX

func NewReader

func NewReader(cfg ReaderConfigInterface) *Reader

NewReader creates a new Reader object

func (*Reader) Close

func (r *Reader) Close()

Close makes sure the kafka.Reader.Close function is called

func (*Reader) Config

func (r *Reader) Config() interface{}

Config returns the internal ReaderConfigInterface (will need to be casted)

func (*Reader) Get

func (r *Reader) Get(ctx context.Context) (interface{}, error)

Get returns the internal reader object (will need to be casted) if present

func (*Reader) Renew

func (r *Reader) Renew(tlsCfg config.TLSConfigInterface, saslConfig config.SASLConfigInterface, args ...interface{})

Renew creates a new kafka.Reader with the new tls and sasl configs passed in and updates the instance

func (*Reader) Stats

func (r *Reader) Stats() interface{}

Stats returns a copy of kafka.ReaderStats (will need to be casted)

type ReaderConfigInterface added in v1.2.0

type ReaderConfigInterface interface {
	config.ConfigInterface
	GetBootstrapServers() []string
	GetTopic() string
	GetGroupID() string
	GetReadTimeout() time.Duration
	Workers() int
}

ReaderConfigInterface is the core.Reader config interface, embeds config.ConfigInterface

type RefreshableInterface added in v1.2.0

type RefreshableInterface interface {
	Get(context.Context) (interface{}, error)
	Config() interface{}
	Close()
	Stats() interface{}
	Renew(config.TLSConfigInterface, config.SASLConfigInterface, ...interface{})
}

RefreshableInterface is implemented by core.Writer and core.Reader so that they can be refreshed by AutoRefreshX

type Writer

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

Writer is an abstraction object on top of kakfa.Writer it holds the creation config as attribute and a pointer to the writer itself it implements RefreshableInterface so that can be used by AutoRefreshX

func NewWriter

func NewWriter(cfg WriterConfigInterface) *Writer

NewWriter creates a new object

func (*Writer) Close

func (w *Writer) Close()

Close makes sure the kafka.Reader.Close function is called

func (*Writer) Config

func (w *Writer) Config() interface{}

Config returns the internal ReaderConfigInterface (will need to be casted)

func (*Writer) Get

func (w *Writer) Get(ctx context.Context) (interface{}, error)

Get returns the internal reader object (will need to be casted) if present

func (*Writer) Renew

func (w *Writer) Renew(tlsConfig config.TLSConfigInterface, saslConfig config.SASLConfigInterface, args ...interface{})

Renew creates a new kafka.Writer with the new tls config passed in and updates the instance

func (*Writer) Stats

func (w *Writer) Stats() interface{}

Stats returns a copy of kafka.ReaderStats (will need to be casted)

type WriterConfigInterface added in v1.2.0

type WriterConfigInterface interface {
	config.ConfigInterface
	GetBrokers() []string
	GetTopic() string
	GetNickname() string
	GetAsync() bool
	GetEncoder() encoder.EncoderInterface
}

WriterConfigInterface is the core.Writer config interface, embeds config.ConfigInterface

Jump to

Keyboard shortcuts

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