Documentation
¶
Index ¶
- func BuildConfig(appID int, appHash, dropboxAppKey, dropboxAppSecret string, chats []ChatInput) *config.Config
- func DropboxAuthURL(appKey string) string
- func Mask(s string) string
- func OpenBrowser(u string) error
- func WriteConfig(dir string, cfg *config.Config) error
- func WriteDropboxTokens(dir string, tokens *DropboxTokens) error
- type ChatInput
- type DropboxTokens
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildConfig ¶
func BuildConfig(appID int, appHash, dropboxAppKey, dropboxAppSecret string, chats []ChatInput) *config.Config
BuildConfig creates a config.Config from the wizard inputs.
func DropboxAuthURL ¶
DropboxAuthURL constructs the Dropbox OAuth2 authorization URL.
func OpenBrowser ¶
OpenBrowser tries to open the given URL in the user's default browser.
func WriteConfig ¶
WriteConfig serializes cfg to config.yaml in the given directory. It uses an atomic write (temp file + rename) so that file watchers never see a half-written config.
func WriteDropboxTokens ¶
func WriteDropboxTokens(dir string, tokens *DropboxTokens) error
WriteDropboxTokens serializes tokens to dropbox.json in the given directory.
Types ¶
type ChatInput ¶
type ChatInput struct {
Handle string
}
ChatInput holds a chat handle passed from the TUI.
type DropboxTokens ¶
type DropboxTokens struct {
AccessToken string `json:"access_token"`
RefreshToken string `json:"refresh_token"`
}
DropboxTokens holds the OAuth tokens returned by Dropbox.
func ExchangeDropboxCode ¶
func ExchangeDropboxCode(appKey, appSecret, code string) (*DropboxTokens, error)
ExchangeDropboxCode exchanges an authorization code for access and refresh tokens.
Click to show internal directories.
Click to hide internal directories.