mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
move vdomclient to waveapp (#1290)
This commit is contained in:
parent
2dfdf66169
commit
8b672211a9
@ -1,7 +1,7 @@
|
||||
// Copyright 2024, Command Line Inc.
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
package vdomclient
|
||||
package waveapp
|
||||
|
||||
import (
|
||||
"bytes"
|
@ -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)
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user