faker

package
v0.2.2-beta.1 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2025 License: MIT Imports: 6 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
}

func NewReader

func NewReader(autoCommit bool, l *slog.Logger) (*Reader, error)

func (*Reader) Ack

func (r *Reader) Ack(
	ctx context.Context, msgIDs [][]byte,
	ackHandler func(error),
	ackMsgHandler func([]byte, error),
)

func (*Reader) Close

func (r *Reader) Close()

func (*Reader) EncodeMsgID

func (r *Reader) EncodeMsgID(buf []byte, topic string, args ...any) []byte

func (*Reader) Fetch

func (r *Reader) Fetch(
	ctx context.Context, n uint32,
	fetchHandler func(n uint32, err error),
	msgHandler func(message []byte, topic string, args ...any),
)

func (*Reader) HFetch

func (r *Reader) HFetch(
	ctx context.Context, n uint32,
	fetchHandler func(n uint32, err error),
	msgHandler func(message []byte, topic string, hs [][]byte, args ...any),
)

func (*Reader) HSubscribe

func (r *Reader) HSubscribe(ctx context.Context, h func(message []byte, topic string, hs [][]byte, args ...any)) error

func (*Reader) IsAutoCommit

func (r *Reader) IsAutoCommit() bool

func (*Reader) MsgIDStaticArgsLen

func (r *Reader) MsgIDStaticArgsLen() int

func (*Reader) Nack

func (r *Reader) Nack(
	ctx context.Context, msgIDs [][]byte,
	nackHandler func(error),
	nackMsgHandler func([]byte, error),
)

func (*Reader) Subscribe

func (r *Reader) Subscribe(ctx context.Context, h func(message []byte, topic string, args ...any)) error

type Writer

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

func NewWriter

func NewWriter(l *slog.Logger) (*Writer, error)

func (*Writer) BeginTx

func (w *Writer) BeginTx(_ context.Context) error

func (*Writer) Close

func (w *Writer) Close() error

func (*Writer) CommitTx

func (w *Writer) CommitTx(_ context.Context) error

func (*Writer) Endpoint

func (w *Writer) Endpoint() string

func (*Writer) Flush

func (w *Writer) Flush(_ context.Context) error

func (*Writer) HProduce

func (w *Writer) HProduce(_ context.Context, msg []byte, headers [][]byte, callback func(err error))

func (*Writer) Produce

func (w *Writer) Produce(_ context.Context, msg []byte, callback func(err error))

func (*Writer) RollbackTx

func (w *Writer) RollbackTx(_ context.Context) error

Jump to

Keyboard shortcuts

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