Skip to content

Commit e4f5438

Browse files
committed
chore(agent): add consts for connection version on listen
1 parent e0737af commit e4f5438

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pkg/agent/agent.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,13 +392,18 @@ func (a *Agent) Close() error {
392392
return (*l).Close()
393393
}
394394

395+
const (
396+
ConnectionV1 = 1
397+
ConnectionV2 = 2
398+
)
399+
395400
func (a *Agent) Listen(ctx context.Context) error {
396401
a.mode.Serve(a)
397402

398403
switch a.config.ConnectionVersion {
399-
case 1:
404+
case ConnectionV1:
400405
return a.listenV1(ctx)
401-
case 2:
406+
case ConnectionV2:
402407
return a.listenV2(ctx)
403408
default:
404409
return fmt.Errorf("unsupported connection version: %d", a.config.ConnectionVersion)

0 commit comments

Comments
 (0)