From 8b672211a96c6ce400a464c5619e085558b5439e Mon Sep 17 00:00:00 2001 From: Mike Sawka Date: Thu, 14 Nov 2024 13:32:58 -0800 Subject: [PATCH] move vdomclient to waveapp (#1290) --- pkg/{vdom/vdomclient => waveapp}/streamingresp.go | 2 +- .../vdomclient/vdomclient.go => waveapp/waveapp.go} | 6 +++--- .../vdomserverimpl.go => waveapp/waveappserverimpl.go} | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) rename pkg/{vdom/vdomclient => waveapp}/streamingresp.go (99%) rename pkg/{vdom/vdomclient/vdomclient.go => waveapp/waveapp.go} (98%) rename pkg/{vdom/vdomclient/vdomserverimpl.go => waveapp/waveappserverimpl.go} (88%) diff --git a/pkg/vdom/vdomclient/streamingresp.go b/pkg/waveapp/streamingresp.go similarity index 99% rename from pkg/vdom/vdomclient/streamingresp.go rename to pkg/waveapp/streamingresp.go index 6a8456786..e651d2846 100644 --- a/pkg/vdom/vdomclient/streamingresp.go +++ b/pkg/waveapp/streamingresp.go @@ -1,7 +1,7 @@ // Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 -package vdomclient +package waveapp import ( "bytes" diff --git a/pkg/vdom/vdomclient/vdomclient.go b/pkg/waveapp/waveapp.go similarity index 98% rename from pkg/vdom/vdomclient/vdomclient.go rename to pkg/waveapp/waveapp.go index 14f8f54a8..2dfe33eac 100644 --- a/pkg/vdom/vdomclient/vdomclient.go +++ b/pkg/waveapp/waveapp.go @@ -1,7 +1,7 @@ // Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 -package vdomclient +package waveapp import ( "context" @@ -44,7 +44,7 @@ type Client struct { RootElem *vdom.VDomElem RpcClient *wshutil.WshRpc RpcContext *wshrpc.RpcContext - ServerImpl *VDomServerImpl + ServerImpl *WaveAppServerImpl IsDone bool RouteId string VDomContextBlockId string @@ -171,7 +171,7 @@ func (client *Client) Connect() error { if client.RpcContext == nil || client.RpcContext.BlockId == "" { return fmt.Errorf("no block id in rpc context") } - client.ServerImpl = &VDomServerImpl{BlockId: client.RpcContext.BlockId, Client: client} + client.ServerImpl = &WaveAppServerImpl{BlockId: client.RpcContext.BlockId, Client: client} sockName, err := wshutil.ExtractUnverifiedSocketName(jwtToken) if err != nil { return fmt.Errorf("error extracting socket name from %s: %v", wshutil.WaveJwtTokenVarName, err) diff --git a/pkg/vdom/vdomclient/vdomserverimpl.go b/pkg/waveapp/waveappserverimpl.go similarity index 88% rename from pkg/vdom/vdomclient/vdomserverimpl.go rename to pkg/waveapp/waveappserverimpl.go index d9aabc861..33cff5519 100644 --- a/pkg/vdom/vdomclient/vdomserverimpl.go +++ b/pkg/waveapp/waveappserverimpl.go @@ -1,7 +1,7 @@ // Copyright 2024, Command Line Inc. // SPDX-License-Identifier: Apache-2.0 -package vdomclient +package waveapp import ( "bytes" @@ -14,14 +14,14 @@ import ( "github.com/wavetermdev/waveterm/pkg/wshrpc" ) -type VDomServerImpl struct { +type WaveAppServerImpl struct { Client *Client BlockId string } -func (*VDomServerImpl) WshServerImpl() {} +func (*WaveAppServerImpl) WshServerImpl() {} -func (impl *VDomServerImpl) VDomRenderCommand(ctx context.Context, feUpdate vdom.VDomFrontendUpdate) chan wshrpc.RespOrErrorUnion[*vdom.VDomBackendUpdate] { +func (impl *WaveAppServerImpl) VDomRenderCommand(ctx context.Context, feUpdate vdom.VDomFrontendUpdate) chan wshrpc.RespOrErrorUnion[*vdom.VDomBackendUpdate] { respChan := make(chan wshrpc.RespOrErrorUnion[*vdom.VDomBackendUpdate], 5) defer func() { @@ -99,7 +99,7 @@ func (impl *VDomServerImpl) VDomRenderCommand(ctx context.Context, feUpdate vdom return respChan } -func (impl *VDomServerImpl) VDomUrlRequestCommand(ctx context.Context, data wshrpc.VDomUrlRequestData) chan wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse] { +func (impl *WaveAppServerImpl) VDomUrlRequestCommand(ctx context.Context, data wshrpc.VDomUrlRequestData) chan wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse] { respChan := make(chan wshrpc.RespOrErrorUnion[wshrpc.VDomUrlRequestResponse]) writer := NewStreamingResponseWriter(respChan)