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(_ context.Context, name string, start *monitor.Time, finish *monitor.Time) (monitor.Iterator, 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(_ context.Context, name string, start *monitor.Time, finish *monitor.Time) (monitor.Iterator, error)
Stream returns an iterator 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 caller should ensure that the returned Iterator is closed, otherwise a resource leak will result.
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.