Documentation
¶
Index ¶
- Constants
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) IsLogName(_ context.Context, name string) (bool, error)
- func (c *Connection) LogNames(_ context.Context) ([]string, error)
- func (c *Connection) Stream(ctx context.Context, name string, start *monitor.Time, finish *monitor.Time) (itr iter.Seq[monitor.Entry], finished func() error)
- type Option
Constants ¶
const ( DefaultBrokerAddr = "localhost:9092" // The default broker address to use if no broker addresses are specified. DefaultLifetime = time.Minute )
The default option values.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
log.BasicLogable
// contains filtered or unexported fields
}
Connection represents a connection to Kafka.
func (*Connection) LogNames ¶
func (c *Connection) LogNames(_ context.Context) ([]string, error)
LogNames returns the log names.
func (*Connection) Stream ¶
func (c *Connection) Stream(ctx context.Context, name string, start *monitor.Time, finish *monitor.Time) (itr iter.Seq[monitor.Entry], finished func() error)
Stream returns an iterator 'itr' down which entries from the log 'name' are passed. Only entries falling into the range determined by start and finish will be returned. If start is unassigned then the start of the log will be used; if end is unassigned then no end is used. The iterator 'itr' is bound to the given context. Iteration will be terminated on error. Any error will be reported by the returned 'finished' function.
It returns a single-use iterator.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option sets options on a Kafka logger.
func AddBrokerAddr ¶
AddBrokerAddr adds the given addresses to the slice of Kafka broker address. Broker addresses should be in the format "hostname:port". DefaultBrokerAddr if and only if no broker addresses are added.