Documentation
¶
Index ¶
- func EnsureDirectories() error
- func Execute() error
- func GetAliasesPath() string
- func GetConfigDir() string
- func GetFields() []string
- func GetMediaDir() string
- func GetMessagesDBPath() string
- func GetSessionDBPath() string
- func GetStoreDir() string
- func IsJSON() bool
- func IsVerbose() bool
- func NoAutoSync() bool
- func NoHeader() bool
- func Output(data any) error
- func OutputResult(data any, humanMsg string) error
- func OutputWarning(format string, args ...any)
- func ParseTimeframe(timeframe string) (after string, before string, err error)
- func RemoveAlias(jid string) error
- func SetAlias(jid, alias string) error
- func SetStoreDir(dir string)
- func WithConnection(fn func(*store.DB, *whatsapp.Client) error) error
- func WithDB(fn func(*store.DB) error) error
- type Aliases
- type Format
- type JIDAlias
- type OutputOptions
- type TimeframePreset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureDirectories ¶
func EnsureDirectories() error
EnsureDirectories creates all necessary directories
func GetAliasesPath ¶
func GetAliasesPath() string
GetAliasesPath returns the path to the aliases file
func GetConfigDir ¶
func GetConfigDir() string
GetConfigDir returns the config directory path Uses XDG_CONFIG_HOME if set, otherwise ~/.config/whatsapp-cli
func GetFields ¶
func GetFields() []string
GetFields returns the list of fields to include in output
func GetMessagesDBPath ¶
func GetMessagesDBPath() string
GetMessagesDBPath returns the path to the messages database
func GetSessionDBPath ¶
func GetSessionDBPath() string
GetSessionDBPath returns the path to the whatsmeow session database
func NoAutoSync ¶ added in v0.2.0
func NoAutoSync() bool
NoAutoSync returns whether auto-sync is disabled
func OutputResult ¶
OutputResult outputs structured data for machine formats, or a human message for human format
func OutputWarning ¶
OutputWarning prints warning to stderr (for non-fatal issues)
func ParseTimeframe ¶
ParseTimeframe converts a timeframe preset string into after/before timestamps.
func WithConnection ¶
WithConnection opens the database, creates a WhatsApp client, verifies authentication, connects to WhatsApp, and runs the provided function. Performs auto-sync if last sync was over 24 hours ago.
Types ¶
type Aliases ¶
Aliases manages local JID aliases
type JIDAlias ¶
JIDAlias maps JIDs to their aliases (reversed from Aliases)
func ListAliases ¶
ListAliases returns all aliases as JID -> alias map
type OutputOptions ¶
type OutputOptions struct {
Format Format
Fields []string // Field names to include (empty = all)
NoHeader bool // Skip header row for CSV/TSV
}
OutputOptions controls output behavior
func GetOutputOptions ¶
func GetOutputOptions() OutputOptions
GetOutputOptions returns the current output options
func (OutputOptions) Validate ¶
func (o OutputOptions) Validate() error
Validate checks if the options are valid
type TimeframePreset ¶
type TimeframePreset string
TimeframePreset represents a named time range.
const ( TimeframeLastHour TimeframePreset = "last_hour" TimeframeToday TimeframePreset = "today" TimeframeYesterday TimeframePreset = "yesterday" TimeframeLast3Days TimeframePreset = "last_3_days" TimeframeThisWeek TimeframePreset = "this_week" TimeframeLastWeek TimeframePreset = "last_week" TimeframeThisMonth TimeframePreset = "this_month" )