setup

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

func DropboxAuthURL(appKey string) string

DropboxAuthURL constructs the Dropbox OAuth2 authorization URL.

func Mask

func Mask(s string) string

Mask returns a partially redacted version of a secret string.

func OpenBrowser

func OpenBrowser(u string) error

OpenBrowser tries to open the given URL in the user's default browser.

func WriteConfig

func WriteConfig(dir string, cfg *config.Config) error

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.

Jump to

Keyboard shortcuts

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