topic

package
v0.0.0-...-ff439f2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CaravanDebug = "CARAVAN_DEBUG"
)

Environment variables

View Source
const (
	MsgInstantiationTrace = "stack at time of instantiation"
)

Error messages

Variables

View Source
var (
	Debug = &debugger{}
)

Functions

func Make

func Make[Msg any](o ...config.Option) topic.Topic[Msg]

Make instantiates a new internal Topic instance

Types

type Closer

type Closer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Closer is an internal implementation of a closer.Closer

func (*Closer) Close

func (c *Closer) Close()

Close will instruct the Closer to stop and free its resources

func (*Closer) IsClosed

func (c *Closer) IsClosed() <-chan struct{}

IsClosed returns a channel that can participate in a select

type ErrorWrapper

type ErrorWrapper func(error) error

ErrorWrapper is a function that wraps an error. It is returned by WrapStackTrace to attach stack information to a standard error

func WrapStackTrace

func WrapStackTrace(msg string) ErrorWrapper

WrapStackTrace returns an ErrorWrapper that attaches Stack information to an error based on the call stack when this function is invoked

type Log

type Log[Msg any] struct {
	// contains filtered or unexported fields
}

Log manages a set of segments that contain Log entries

type Topic

type Topic[Msg any] struct {
	*config.Config
	// contains filtered or unexported fields
}

Topic is the internal implementation of a Topic

func (*Topic[Msg]) Get

func (t *Topic[Msg]) Get(o retention.Offset) (Msg, retention.Offset, bool)

Get consumes a message starting at the specified virtual Offset within the Topic. If the Offset is no longer being retained, the next available Offset will be consumed. The actual Offset read is returned

func (*Topic[_]) Length

func (t *Topic[_]) Length() topic.Length

Length returns the virtual size of the Topic

func (*Topic[Msg]) NewConsumer

func (t *Topic[Msg]) NewConsumer() topic.Consumer[Msg]

NewConsumer instantiates a new Topic Consumer

func (*Topic[Msg]) NewProducer

func (t *Topic[Msg]) NewProducer() topic.Producer[Msg]

NewProducer instantiates a new Topic Producer

func (*Topic[Msg]) Put

func (t *Topic[Msg]) Put(msg Msg)

Put adds the specified Message to the Topic

Jump to

Keyboard shortcuts

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