feat: allow custom QR login output
This commit is contained in:
@@ -36,6 +36,17 @@ func WithHTTPClient(httpClient *http.Client) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithQRWriter configures where QR login output is written.
|
||||
func WithQRWriter(writer io.Writer) Option {
|
||||
return func(client *Client) error {
|
||||
if writer == nil {
|
||||
return fmt.Errorf("QR writer must not be nil")
|
||||
}
|
||||
client.qrWriter = writer
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
authPath string
|
||||
authMu sync.RWMutex
|
||||
|
||||
Reference in New Issue
Block a user