{"modulePath":"github.com/labstack/pitot","version":"v0.0.0-20261123231833-0301fe8e3bdc","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package writegate\n\nPackage writegate serializes and measures writes to DuckDB's rebuildable rollup cache.\n\n## Types\n\n```go\ntype Gate struct {\n\t// contains filtered or unexported fields\n}\n```\nGate serializes DuckDB writes while measuring how long each operation waits for and holds the critical section. The zero value is ready for use.\n\n```go\nfunc (g *Gate) Lock(operation Operation) func()\n```\nLock acquires the cache write gate and returns its release function. Callers must defer the returned function before acquiring a database connection, transaction, or appender, and must call it exactly once.\n\n```go\nfunc (g *Gate) LockContext(ctx context.Context, operation Operation) (func(), error)\n```\nLockContext acquires the cache write gate, or returns when ctx expires.\n\n```go\nfunc (g *Gate) TryLock(operation Operation) func()\n```\nTryLock acquires an idle gate, returning nil when another writer owns it. Optional cache work must not delay authoritative Parquet publication.\n\n```go\ntype Operation string\n```\nOperation is a bounded metric label for a rollup-cache write. Keep this list exhaustive: arbitrary strings would create an unbounded Prometheus label surface.\n\n```go\nconst (\n\tRollupSkip    Operation = \"rollup_skip_to_latest\"\n\tRollupService Operation = \"rollup_service\"\n\tReadCache     Operation = \"read_cache\"\n\tRollupEdge    Operation = \"rollup_edge\"\n\tRollupVersion Operation = \"rollup_version\"\n\tAnomalyLog    Operation = \"anomaly_log\"\n\tMaintenance   Operation = \"maintenance\"\n)\n```\n\n","path":"github.com/labstack/pitot/internal/engine/writegate","name":"writegate","synopsis":"Package writegate serializes and measures writes to DuckDB's rebuildable rollup cache.","isRedistributable":true}
