Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
7294f90
chore: quick update fix/router at 2026-01-11 14:49:51
kooksee Jan 11, 2026
59c44d0
chore: quick update fix/router at 2026-01-11 20:17:43
kooksee Jan 11, 2026
56c7df2
chore: quick update fix/router at 2026-01-12 21:49:58
kooksee Jan 12, 2026
fabd282
chore: quick update fix/router at 2026-01-19 13:31:33
kooksee Jan 19, 2026
7e4306a
chore: quick update fix/router at 2026-01-19 16:05:06
kooksee Jan 19, 2026
d2e3fa0
chore: quick update fix/router at 2026-01-19 16:23:57
kooksee Jan 19, 2026
59ee1ee
chore: quick update fix/router at 2026-01-19 16:30:16
kooksee Jan 19, 2026
7dcde43
chore: quick update fix/router at 2026-01-19 18:17:00
kooksee Jan 19, 2026
e9d1a5e
chore: quick update fix/router at 2026-01-20 00:31:56
kooksee Jan 19, 2026
e160430
chore: quick update fix/router at 2026-01-20 17:03:09
kooksee Jan 20, 2026
5b0148e
chore: quick update fix/router at 2026-01-20 18:56:48
kooksee Jan 20, 2026
a0a8edf
chore: quick update fix/router at 2026-01-20 19:15:42
kooksee Jan 20, 2026
8db3040
chore: quick update fix/router at 2026-01-20 23:32:26
kooksee Jan 20, 2026
35667f2
chore: quick update fix/router at 2026-01-20 23:49:57
kooksee Jan 20, 2026
c2acf71
chore: quick update fix/router at 2026-01-22 10:00:16
kooksee Jan 22, 2026
b9faf26
chore: quick update fix/router at 2026-01-22 10:00:55
kooksee Jan 22, 2026
a920adc
chore: quick update fix/router at 2026-01-24 01:26:59
kooksee Jan 23, 2026
93e8577
chore: quick update fix/router at 2026-01-24 12:24:39
kooksee Jan 24, 2026
fb88d13
chore: quick update fix/router at 2026-01-26 18:45:52
kooksee Jan 26, 2026
8e11b15
chore: quick update fix/router at 2026-01-27 09:51:08
kooksee Jan 27, 2026
4bd9213
chore: quick update fix/router at 2026-01-27 10:17:15
kooksee Jan 27, 2026
362a661
chore: quick update fix/router at 2026-01-27 10:23:20
kooksee Jan 27, 2026
6c22433
chore: quick update fix/router at 2026-01-27 10:23:57
kooksee Jan 27, 2026
75e3935
chore: quick update fix/router at 2026-01-27 11:47:13
kooksee Jan 27, 2026
aa6fc06
chore: quick update fix/router at 2026-01-27 15:53:56
kooksee Jan 27, 2026
6791e7c
refactor(clients/resty): extract common utilities and improve code or…
kooksee Jan 28, 2026
568919a
test(resty): add unit tests for request creation and building
kooksee Jan 28, 2026
b40a43a
chore: quick update fix/router at 2026-01-31 16:30:16
kooksee Jan 31, 2026
16011e8
chore: quick update fix/router at 2026-01-31 17:06:41
kooksee Jan 31, 2026
8aa101a
chore: quick update fix/router at 2026-01-31 17:14:42
kooksee Jan 31, 2026
2e22952
chore: quick update fix/router at 2026-01-31 17:16:52
kooksee Jan 31, 2026
0c2636c
chore: quick update fix/router at 2026-01-31 18:31:08
kooksee Jan 31, 2026
546a827
chore: quick update fix/router at 2026-02-01 10:54:00
kooksee Feb 1, 2026
726c409
chore: quick update fix/router at 2026-02-04 20:39:34
kooksee Feb 4, 2026
93c1a15
chore: quick update fix/router at 2026-02-04 21:52:50
kooksee Feb 4, 2026
b150a92
chore: quick update fix/router at 2026-02-04 21:56:18
kooksee Feb 4, 2026
08292c1
chore: quick update fix/router at 2026-02-10 14:42:36
kooksee Feb 10, 2026
e0c22ae
chore: quick update fix/router at 2026-02-10 15:07:00
kooksee Feb 10, 2026
50cc1d3
chore: quick update fix/router at 2026-02-10 16:49:44
kooksee Feb 10, 2026
314f33a
chore: quick update fix/router at 2026-02-10 18:05:32
kooksee Feb 10, 2026
e2f68a0
chore: quick update fix/router at 2026-02-10 18:17:20
kooksee Feb 10, 2026
bf6a04c
chore: quick update fix/router at 2026-02-10 18:22:05
kooksee Feb 10, 2026
230ccdd
chore: quick update fix/router at 2026-02-10 18:45:14
kooksee Feb 10, 2026
d509739
chore: quick update fix/router at 2026-02-10 19:05:16
kooksee Feb 10, 2026
e5623c2
chore: quick update fix/router at 2026-02-10 20:26:54
kooksee Feb 10, 2026
c84994b
chore: quick update fix/router at 2026-02-10 20:46:41
kooksee Feb 10, 2026
5e1ed1c
chore: quick update fix/router at 2026-02-13 00:35:30
kooksee Feb 12, 2026
4d04067
chore: quick update fix/router at 2026-02-13 00:49:24
kooksee Feb 12, 2026
430c467
chore: quick update fix/router at 2026-02-13 21:41:59
kooksee Feb 13, 2026
336e302
chore: quick update fix/router at 2026-02-13 21:50:55
kooksee Feb 13, 2026
78f83cb
chore: quick update fix/router at 2026-02-13 22:09:20
kooksee Feb 13, 2026
5b10ad7
chore: quick update fix/router at 2026-02-14 12:17:43
kooksee Feb 14, 2026
ac58db5
chore: quick update fix/router at 2026-02-14 20:41:59
kooksee Feb 14, 2026
ea4956e
chore: quick update fix/router at 2026-02-14 20:44:58
kooksee Feb 14, 2026
e6c30a0
chore: quick update fix/router at 2026-02-14 21:29:13
kooksee Feb 14, 2026
72d34a2
chore: quick update fix/router at 2026-02-14 21:39:02
kooksee Feb 14, 2026
ac31f1a
chore: quick update fix/router at 2026-02-14 21:41:37
kooksee Feb 14, 2026
79ddbcb
chore: quick update fix/router at 2026-02-14 21:43:56
kooksee Feb 14, 2026
02e0a82
chore: quick update fix/router at 2026-02-14 21:44:39
kooksee Feb 14, 2026
a8deef2
chore: quick update fix/router at 2026-02-23 17:32:47
kooksee Feb 23, 2026
7460203
chore: quick update fix/router at 2026-02-24 13:49:04
kooksee Feb 24, 2026
15d8905
refactor: update debug routes and dependencies
kooksee Feb 25, 2026
46a5543
feat: add fileserver command and remove standalone tool
kooksee Feb 25, 2026
105cc91
feat: update dix debug endpoints and dependencies
kooksee Feb 26, 2026
ebc3993
feat: add devproxy tool and resty client docs
kooksee Feb 27, 2026
89a13b0
chore: quick update fix/router at 2026-02-27 18:44:16
kooksee Feb 27, 2026
ecca222
Merge branch 'fix/router' of github.com:pubgo/lava into fix/router
kooksee Mar 18, 2026
d7be303
chore: update protoc version to v6.33.4 and adjust go_package paths i…
kooksee Mar 18, 2026
ac7e65f
chore: quick update fix/router at 2026-03-18 23:03:31
kooksee Mar 18, 2026
693a0a4
feat: 增强 gRPC Web 支持,添加服务端响应流功能并更新文档
kooksee Mar 23, 2026
310e0da
Merge branch 'fix/router' of github.com:pubgo/lava into fix/router
kooksee Mar 23, 2026
1111839
chore: 格式化 gRPC Web 文档中的表格并调整代码注释对齐
kooksee Mar 23, 2026
47e453a
feat: 添加 streamHTTP 的单元测试,验证 SendHeader 和 SetHeader 的行为
kooksee Mar 23, 2026
624b8ab
fix: 修复响应流中头部预取逻辑,确保在第一帧之前不获取头部
kooksee Mar 23, 2026
67a3580
fix: 处理重复响应流头部发送错误,增强错误日志记录
kooksee Mar 24, 2026
c292e59
fix: 更新文档格式,增强 gRPC 内容类型处理逻辑的测试覆盖
kooksee Mar 24, 2026
630e9a4
fix: 更新架构文档,增强核心组件描述和流程图可读性
kooksee Mar 24, 2026
ac8feb5
fix: 移除冗余的 gRPC Web 处理逻辑,简化 ServeHTTP 方法
kooksee Mar 24, 2026
1486d51
fix: 重命名 invokeResponseStream 方法参数,增强代码可读性
kooksee Mar 24, 2026
2a68a52
fix: 重构路由处理逻辑,简化路由函数参数类型
kooksee Mar 25, 2026
cbf700a
fix: 移除冗余的生命周期依赖,简化服务管理逻辑
kooksee Apr 1, 2026
00f3a46
chore: quick update fix/router at 2026-04-01 20:46:42
kooksee Apr 1, 2026
f1f4d11
chore: quick update fix/router at 2026-04-01 21:55:54
kooksee Apr 1, 2026
b7525e4
chore: quick update fix/router at 2026-04-16 23:09:07
kooksee Apr 16, 2026
8b4b15a
chore: quick update fix/router at 2026-04-16 23:12:11
kooksee Apr 16, 2026
2449644
fix: 更新依赖项版本,修复 funk 和 redant 包的版本号
kooksee May 11, 2026
7e0bf95
fix: 优化请求绑定逻辑,减少重复调用 ctx.Bind()
kooksee May 11, 2026
25378a1
feat: 添加运行时信息模块,优化中间件和请求参数设置
kooksee May 11, 2026
16cb98c
fix: 更新 funk 包版本,从 v2.0.1-beta.1 升级到 v2.0.1
kooksee May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .devproxy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dns:
port: 1053
http:
port: 80

routes:
- pattern: "debug"
target: "localhost:8082"
path: "/debug"
60 changes: 60 additions & 0 deletions .github/agents/lava-reviewer.agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
name: Lava Reviewer
description: "Use when: reviewing Lava pull requests, auditing Go backend changes, checking architectural boundaries, and producing actionable fix recommendations with verification steps."
tools: [read, search, execute, todo]
argument-hint: "Provide PR context, changed files, or review focus (e.g., concurrency, API compatibility, proto workflow)."
user-invocable: true
disable-model-invocation: false
---

You are a specialist code reviewer for the Lava repository.

Your job is to assess change quality, identify concrete risks, and return concise, actionable fixes with a verification plan aligned to this repository.

## Constraints

- Focus on review and recommendations first; do not perform broad refactors unless explicitly requested.
- Keep comments evidence-based and tie findings to specific files/symbols/behaviors.
- Preserve public API and architectural boundaries unless change intent requires otherwise.
- Do not suggest editing generated protobuf files (`*.pb.go`) directly.
- Prefer minimal, high-signal findings over exhaustive low-value commentary.

## Repository-Specific Guardrails

- Treat `Taskfile.yml` as local workflow source of truth.
- For standard verification, prioritize:
1. `task test`
2. `task lint`
- If `.proto` or `protobuf.yaml` is touched, require:
1. `task proto:fmt`
2. `task proto:lint`
3. `task proto:gen`
4. then `task test` and `task lint`
- Check module placement decisions against Lava boundaries:
- `lava/` abstractions
- `core/` runtime capabilities
- `servers/` serving behavior
- `clients/` outbound clients
- `pkg/` reusable public components
- `internal/` internal-only implementation

## Review Approach

1. Inspect changed areas and summarize intent in 3-6 bullets.
2. Evaluate correctness risks (concurrency, lifecycle, error handling, resource leaks, API behavior changes).
3. Evaluate design fit (module boundary placement, reuse of existing patterns, compatibility impact).
4. Evaluate operability (logs, metrics/tracing implications, failure modes).
5. Propose minimal fixes with rationale and impact.
6. Return a prioritized verification checklist and expected pass criteria.

## Output Format

Use this structure:

- **Scope understood**: what was reviewed.
- **Top findings**: prioritized list (`critical` / `high` / `medium` / `low`).
- **Suggested fixes**: minimal patch strategy per finding.
- **Validation plan**: exact commands and what success looks like.
- **Residual risks**: anything not fully verifiable from current context.

When there are no material issues, explicitly state **"No blocking issues found"** and still provide a short validation summary.
69 changes: 69 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Project Guidelines for Lava

## Scope

These instructions are project-wide defaults for this repository. Keep changes focused, minimal, and aligned with existing patterns.

## Architecture

- `lava/`: core public interfaces and contracts (`Middleware`, routers, request/response abstractions).
- `core/`: runtime capabilities (supervisor, scheduler, tunnel, logging/metrics/tracing, debug, DI builder).
- `servers/`: service hosts (`https` on Fiber, `grpcs` with gateway integration).
- `clients/`: outbound client implementations (`grpcc`, `resty`).
- `pkg/`: reusable public utilities/components (including gateway and helpers).
- `internal/`: repository-internal implementation details/examples; avoid exposing as public API.

Place new code by responsibility:
- Cross-protocol abstractions -> `lava/`
- Runtime framework capability -> `core/<module>/`
- HTTP/gRPC serving behavior -> `servers/`
- Reusable public helper/component -> `pkg/`
- Internal-only implementation -> `internal/`

## Build and Test

Run commands from repository root.

Primary local workflow (source of truth: `Taskfile.yml`):
- `task test` (Go tests: short + race + cover)
- `task lint` (golangci-lint)

When `.proto` files or `protobuf.yaml` change, run:
- `task proto:fmt`
- `task proto:lint`
- `task proto:gen`
- then `task test` and `task lint`

CI reference is `.github/workflows/lint-test.yml` (lint + gotestsum-based tests).

## Conventions

- Follow standard Go formatting and idioms (`gofmt`, package naming, error-last returns).
- Prefer wrapping errors with context (project commonly uses `github.com/pkg/errors`).
- Keep public APIs and behavior stable unless the task explicitly requires breaking changes.
- Do not edit generated protobuf files (`*.pb.go`) manually; regenerate via proto tasks.
- Prefer updating existing module patterns instead of introducing new architectural styles.

## Pitfalls to Avoid

- `Taskfile.yml` is authoritative for local commands; docs are guidance.
- Lint settings may apply automatic fixes (`.golangci.yaml` has `issues.fix: true`), so re-check diffs after lint.
- Go toolchain target is defined in `go.mod` (`go 1.25.0`).
- For protobuf generation, keep `protobuf.yaml` base module aligned with Go module path (`github.com/pubgo/lava/v2/pkg`).

## Key References

- `README.md`
- `docs/architecture-v2.md`
- `docs/design-v2.md`
- `docs/development.md`
- `Taskfile.yml`
- `.github/workflows/lint-test.yml`

## Representative Examples

- Service lifecycle and management: `core/supervisor/`
- DI registration patterns: `core/lavabuilder/`
- HTTP server composition: `servers/https/server.go`
- gRPC + gateway composition: `servers/grpcs/server.go`
- Gateway behavior and routing: `pkg/gateway/`
38 changes: 38 additions & 0 deletions .github/instructions/backend-go.instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: backend-go
description: "Use when: editing Go backend code in Lava (core/servers/clients/pkg/lava/cmds/internal), including refactors, bug fixes, and tests."
applyTo: "{core,servers,clients,pkg,lava,cmds,internal}/**/*.go"
---

# Lava Backend Go Instructions

- Keep changes minimal and consistent with existing patterns in the target module.
- Place code by responsibility:
- Cross-protocol contracts -> `lava/`
- Runtime framework capabilities -> `core/<module>/`
- Service hosting behavior -> `servers/`
- Outbound client behavior -> `clients/`
- Reusable public helpers/components -> `pkg/`
- Internal-only implementation -> `internal/`
- Preserve public APIs unless the task explicitly requires a breaking change.
- Prefer contextual error wrapping; this repository commonly uses `github.com/pkg/errors`.
- Never hand-edit generated protobuf files (`*.pb.go`); regenerate via proto tasks.
- Follow Go idioms (`gofmt`, package naming, error-last returns).
- Reuse existing module patterns before introducing new architectural styles.

## Validation

- Run from repository root.
- Standard verification flow:
- `task test`
- `task lint`
- If `.proto` or `protobuf.yaml` changes are involved, run first:
- `task proto:fmt`
- `task proto:lint`
- `task proto:gen`

## Pitfalls

- Treat `Taskfile.yml` as the local source of truth.
- Lint may auto-fix files (`.golangci.yaml` sets `issues.fix: true`); re-check diffs after lint.
- Keep Go toolchain aligned with `go.mod` (`go 1.25.0`).
1 change: 0 additions & 1 deletion .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
skip-go-installation: true
args: --timeout 3m --verbose

test:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,5 @@ bin
/example/bin
.proto
proto-vendor
.local
/internal/examples/grpcweb/frontend/node_modules
84 changes: 84 additions & 0 deletions .lava.yaml.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# lava 配置文件示例
# 配置文件可以放在以下位置(按优先级从高到低):
# 1. .lava/lava.yaml
# 2. .lava.yaml
# 3. lava.yaml

# watch 命令配置
watch:
# watcher 列表,可以配置多个 watcher
watchers:
# watcher 1:监控 proto 文件
- name: "proto"
directory: "./proto"
patterns:
- "*.proto"
commands:
- "protobuild gen"
ignore:
- ".git"
- "vendor"
ignore_patterns:
- "*.tmp"
- "*~"
run_on_startup: false
timeout: 30

# watcher 2:监控 go 文件
- name: "go"
directory: "."
patterns:
- "*.go"
commands:
- "go build ./..."
ignore:
- ".git"
- "node_modules"
- "vendor"
- "dist"
- "build"
ignore_patterns:
- "*.tmp"
- "*~"
- ".DS_Store"
run_on_startup: false
timeout: 30

# watcher 3:监控配置文件
- name: "config"
directory: "./internal/configs"
patterns:
- "*.yaml"
commands:
- "echo 'Config changed, reloading...'"
ignore:
- ".git"
run_on_startup: false
timeout: 10

# curl 命令配置
curl:
# 网关地址
addr: "http://127.0.0.1:8080"

# 网关前缀
prefix: "/api"

# 请求超时时间
timeout: "15s"

# 是否跳过 TLS 校验
insecure: false

# 是否对 JSON 响应进行格式化
pretty: true

# gateway 路由信息的 expvar 名称
vars_name: "grpc-server-info"

# 默认的请求头
headers:
- "Content-Type: application/json"

# 默认的查询参数
queries: {}
Loading