feat: allow custom QR login output

This commit is contained in:
2026-07-20 11:00:13 +08:00
parent 378ee865e7
commit 88df3149be
3 changed files with 59 additions and 0 deletions
+11
View File
@@ -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