mirror of
https://github.com/cloudflare/cloudflared.git
synced 2025-07-28 13:59:58 +00:00
TUN-5695: Define RPC method to update configuration
This commit is contained in:
53
tunnelrpc/pogs/cloudflaredrpc.go
Normal file
53
tunnelrpc/pogs/cloudflaredrpc.go
Normal file
@@ -0,0 +1,53 @@
|
||||
package pogs
|
||||
|
||||
import (
|
||||
"github.com/cloudflare/cloudflared/tunnelrpc"
|
||||
capnp "zombiezen.com/go/capnproto2"
|
||||
"zombiezen.com/go/capnproto2/rpc"
|
||||
)
|
||||
|
||||
type CloudflaredServer interface {
|
||||
SessionManager
|
||||
ConfigurationManager
|
||||
}
|
||||
|
||||
type CloudflaredServer_PogsImpl struct {
|
||||
SessionManager_PogsImpl
|
||||
ConfigurationManager_PogsImpl
|
||||
}
|
||||
|
||||
func CloudflaredServer_ServerToClient(s SessionManager, c ConfigurationManager) tunnelrpc.CloudflaredServer {
|
||||
return tunnelrpc.CloudflaredServer_ServerToClient(CloudflaredServer_PogsImpl{
|
||||
SessionManager_PogsImpl: SessionManager_PogsImpl{s},
|
||||
ConfigurationManager_PogsImpl: ConfigurationManager_PogsImpl{c},
|
||||
})
|
||||
}
|
||||
|
||||
type CloudflaredServer_PogsClient struct {
|
||||
SessionManager_PogsClient
|
||||
ConfigurationManager_PogsClient
|
||||
Client capnp.Client
|
||||
Conn *rpc.Conn
|
||||
}
|
||||
|
||||
func NewCloudflaredServer_PogsClient(client capnp.Client, conn *rpc.Conn) CloudflaredServer_PogsClient {
|
||||
sessionManagerClient := SessionManager_PogsClient{
|
||||
Client: client,
|
||||
Conn: conn,
|
||||
}
|
||||
configManagerClient := ConfigurationManager_PogsClient{
|
||||
Client: client,
|
||||
Conn: conn,
|
||||
}
|
||||
return CloudflaredServer_PogsClient{
|
||||
SessionManager_PogsClient: sessionManagerClient,
|
||||
ConfigurationManager_PogsClient: configManagerClient,
|
||||
Client: client,
|
||||
Conn: conn,
|
||||
}
|
||||
}
|
||||
|
||||
func (c CloudflaredServer_PogsClient) Close() error {
|
||||
c.Client.Close()
|
||||
return c.Conn.Close()
|
||||
}
|
Reference in New Issue
Block a user