auth

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FetchQRCode

func FetchQRCode(ctx context.Context, opts ...client.ClientOption) (*types.QRCodeResponse, error)

FetchQRCode fetches a new QR code for bot login.

func LoadCredentials

func LoadCredentials(path string) (*types.Credentials, error)

LoadCredentials reads and unmarshals credentials from a JSON file.

func PollQRStatus

func PollQRStatus(ctx context.Context, qrcode string, onStatus func(status string), opts ...client.ClientOption) (*types.Credentials, error)

PollQRStatus long-polls for QR code scan confirmation. It calls onStatus on each status change and auto-refreshes the QR code up to 3 times when it expires. The total timeout is 480 seconds.

func SaveCredentials

func SaveCredentials(path string, creds *types.Credentials) error

SaveCredentials marshals credentials to JSON and writes them to path with 0600 permissions. Parent directories are created as needed.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL