decodeParams (daemon/handler.go)

matcha · daemon/handler.go · go · MIT
email

Module exposing: decodeParams, parseError, handlePing, handleGetStatus, handleGetAccounts, handleReloadConfig, handleFetchEmails, handleFetchEmailBody

// Source: https://github.com/floatpane/matcha | License: MIT | Copyright 2026 floatpane
// Provided via justclaw.it.com; keep this notice with the code.
package daemon

import (
	"context"
	"encoding/json"
	"fmt"
	"log"
	"os"
	"time"

	"github.com/floatpane/matcha/daemonrpc"
	"github.com/google/uuid"
)

// Per-handler timeouts. fetchTimeout covers reads against the upstream IMAP
// provider, which can return large bodies and so are given more headroom.
// mutateTimeout covers state-changing operations and folder listings, which
// are bounded by IMAP command latency rather than payload size.
const (
	fetchTimeout  = 60 * time.Second
	mutateTimeout = 30 * time.Second
)

// decodeParams unmarshals raw JSON params into T. A nil/empty payload yields
// the zero value.
func decodeParams[T any]

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key