Documentation ¶
Overview ¶
Package lanz implements a LANZ client that will listen to notofications from LANZ streaming server and will decode them and send them as a protobuf over a channel to a receiver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { // Run is the main loop of the client. // It connects to the LANZ server and reads the notifications, decodes them // and sends them to the channel. // In case of disconnect, it will reconnect automatically. Run(ch chan<- *pb.LanzRecord) // Stops the client. Stop() }
Client is the LANZ client interface.
type ConnectReadCloser ¶
type ConnectReadCloser interface { io.ReadCloser // Connect connects to the address, returning an error if it fails. Connect() error }
ConnectReadCloser extends the io.ReadCloser interface with a Connect method.
type Option ¶
type Option func(c *client)
Option is a LANZ client factory option.
func WithAddr ¶
WithAddr specifies the address of the LANZ server. If WithConnector is not used, then WithAddr must be used. When WithConnector is used, WithAddr can be used to pass the address string for displaying.
func WithBackoff ¶
WithBackoff specifies the backoff time after failed connection to LANZ server. It only takes effect for default connector.
func WithConnector ¶
func WithConnector(conn ConnectReadCloser) Option
WithConnector specifies a connector used to communicate with LANZ server.
func WithTimeout ¶
WithTimeout specifies the timeout for connecting to LANZ server. It only takes effect for default connector.