Documentation
¶
Overview ¶
Package cli holds the cobra commands. Each file registers its commands with register(), so new commands (phase 2: wait-new, watch, hook) need no edits here.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "dev" Commit = "" Date = "" )
Build info, set with -ldflags "-X …".
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
Paths config.Paths
Stdout io.Writer
Stderr io.Writer
Stdin io.Reader
// Connect runs fn on an authorised session (tgclient.RunSession).
Connect func(ctx context.Context, opts tgclient.Options, fn func(context.Context, tgclient.Telegram) error) error
// Raw runs fn on a bare connection (tgclient.Run); used by auth and doctor.
Raw func(ctx context.Context, opts tgclient.Options, fn func(context.Context, *tgclient.Conn) error) error
// StdinIsTerminal reports whether prompts can be shown.
StdinIsTerminal func() bool
// ReadSecret reads a secret line without echo when on a terminal.
ReadSecret func(prompt string) (string, error)
// Now, Sleep and Getenv default to the real clock and environment when nil.
Now func() time.Time
Sleep func(ctx context.Context, d time.Duration) error
Getenv func(key string) string
}
App carries I/O and the Telegram connectors; tests swap them for fakes.
Click to show internal directories.
Click to hide internal directories.