cloudflared_server.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. package pogs
  2. import (
  3. capnp "zombiezen.com/go/capnproto2"
  4. "zombiezen.com/go/capnproto2/rpc"
  5. "github.com/cloudflare/cloudflared/tunnelrpc/proto"
  6. )
  7. type CloudflaredServer interface {
  8. SessionManager
  9. ConfigurationManager
  10. }
  11. type CloudflaredServer_PogsImpl struct {
  12. SessionManager_PogsImpl
  13. ConfigurationManager_PogsImpl
  14. }
  15. func CloudflaredServer_ServerToClient(s SessionManager, c ConfigurationManager) proto.CloudflaredServer {
  16. return proto.CloudflaredServer_ServerToClient(CloudflaredServer_PogsImpl{
  17. SessionManager_PogsImpl: SessionManager_PogsImpl{s},
  18. ConfigurationManager_PogsImpl: ConfigurationManager_PogsImpl{c},
  19. })
  20. }
  21. type CloudflaredServer_PogsClient struct {
  22. SessionManager_PogsClient
  23. ConfigurationManager_PogsClient
  24. Client capnp.Client
  25. Conn *rpc.Conn
  26. }
  27. func NewCloudflaredServer_PogsClient(client capnp.Client, conn *rpc.Conn) CloudflaredServer_PogsClient {
  28. sessionManagerClient := SessionManager_PogsClient{
  29. Client: client,
  30. Conn: conn,
  31. }
  32. configManagerClient := ConfigurationManager_PogsClient{
  33. Client: client,
  34. Conn: conn,
  35. }
  36. return CloudflaredServer_PogsClient{
  37. SessionManager_PogsClient: sessionManagerClient,
  38. ConfigurationManager_PogsClient: configManagerClient,
  39. Client: client,
  40. Conn: conn,
  41. }
  42. }
  43. func (c CloudflaredServer_PogsClient) Close() error {
  44. c.Client.Close()
  45. return c.Conn.Close()
  46. }