app

package
v0.0.0-...-0805f42 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

Package app wires command handlers to business logic.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildDryRunSummary

func BuildDryRunSummary(result DryRunResult, opts RenderOptions) artifacts.DryRunSummary

BuildDryRunSummary creates a serializable report model.

func Login

func Login(configPath string, cli config.Overlay, opts LoginOptions) error

Login authenticates with Telegram and saves the session.

func MCPServe

func MCPServe(ctx context.Context, opts MCPServeOptions) error

MCPServe starts the MCP HTTP server.

func RunDemo

func RunDemo(configPath string, cli config.Overlay, stdout io.Writer) error

RunDemo generates test images and uploads them to Saved Messages.

func RunUpload

func RunUpload(configPath string, cli config.Overlay, opts RunOptions) int

RunUpload executes the full upload pipeline and returns an exit code. 0 = success, 1 = partial failure, 2 = fatal error.

func WriteDryRun

func WriteDryRun(w io.Writer, result DryRunResult, opts RenderOptions) error

WriteDryRun writes a stable text summary for dry-run output.

Types

type Clock

type Clock interface {
	Now() time.Time
	Sleep(d time.Duration)
}

Clock abstracts time for deterministic tests.

type DryRunResult

type DryRunResult struct {
	Config config.Config
	Items  []scan.Item
	Plan   plan.Plan
}

DryRunResult captures deterministic dry-run output data.

func ExecuteDryRun

func ExecuteDryRun(configPath string, cliOverlay config.Overlay) (DryRunResult, error)

ExecuteDryRun resolves configuration and builds a scan/plan result.

type LoginMethod

type LoginMethod int

LoginMethod specifies which authentication method to use.

const (
	LoginMethodCode LoginMethod = iota
	LoginMethodQR
)

type LoginOptions

type LoginOptions struct {
	Method LoginMethod
	Phone  string
	Stdout io.Writer
	Stderr io.Writer
}

LoginOptions holds parameters for the login command.

type MCPServeOptions

type MCPServeOptions struct {
	ConfigPath string
	CLI        config.Overlay
}

MCPServeOptions holds parameters for mcp serve.

type RNG

type RNG interface {
	Float64() float64
}

RNG abstracts random sampling for retry/backoff decisions.

type RenderOptions

type RenderOptions struct {
	MaxAlbums        int
	MaxItemsPerAlbum int
}

RenderOptions controls textual preview length.

type RunOptions

type RunOptions struct {
	NoProgress        bool
	ShowPlan          bool
	ShowPlanFiles     bool
	CleanupNow        bool
	ForceMultiCommand bool
	Stdout            io.Writer
	Stderr            io.Writer
}

RunOptions holds parameters for the run command.

type SystemClock

type SystemClock struct{}

SystemClock is the production Clock implementation.

func (SystemClock) Now

func (SystemClock) Now() time.Time

Now implements Clock.

func (SystemClock) Sleep

func (SystemClock) Sleep(d time.Duration)

Sleep implements Clock.

type SystemRNG

type SystemRNG struct{}

SystemRNG is the production RNG implementation.

func (SystemRNG) Float64

func (SystemRNG) Float64() float64

Float64 implements RNG.

Jump to

Keyboard shortcuts

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