Documentation
¶
Index ¶
- func BrowserLogin() (*models.SavedSession, error)
- func ConfigDir() (string, error)
- func CookieLogin(ctx context.Context, token string) (*models.SavedSession, error)
- func DeleteSession() error
- func LoadSession() (*models.SavedSession, error)
- func SaveSession(session *models.SavedSession) error
- func SessionExists() bool
- func SessionPath() (string, error)
- type SessionInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BrowserLogin ¶
func BrowserLogin() (*models.SavedSession, error)
BrowserLogin opens a visible browser for the user to log in to Perplexity, waits for the session cookie, and returns the saved session. If Chrome/Chromium is not installed, it automatically downloads one via Rod.
func CookieLogin ¶
CookieLogin creates a session from a manually provided session token, bypassing browser-based authentication entirely.
func LoadSession ¶
func LoadSession() (*models.SavedSession, error)
LoadSession reads the saved session from disk.
func SaveSession ¶
func SaveSession(session *models.SavedSession) error
SaveSession persists the session to disk with restricted permissions.
func SessionExists ¶
func SessionExists() bool
SessionExists checks whether a session file exists on disk.
func SessionPath ¶
SessionPath returns the full path to the session file.
Types ¶
type SessionInfo ¶
SessionInfo holds the result of validating a session.
func ValidateSession ¶
func ValidateSession(ctx context.Context, session *models.SavedSession) (*SessionInfo, error)
ValidateSession checks if the saved session is still valid by calling Perplexity's NextAuth session endpoint.