-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb0d760
commit 7121751
Showing
4 changed files
with
97 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package proxy | ||
|
||
import "github.com/andydunstall/pico/pkg/rpc" | ||
|
||
// Proxy is responsible for forwarding requests to upstream listeners. | ||
type Proxy struct { | ||
} | ||
|
||
func NewProxy() *Proxy { | ||
return &Proxy{} | ||
} | ||
|
||
func (p *Proxy) AddUpstream(_ string, _ *rpc.Stream) { | ||
} | ||
|
||
func (p *Proxy) RemoveUpstream(_ string, _ *rpc.Stream) { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package server | ||
|
||
import "github.com/andydunstall/pico/pkg/rpc" | ||
|
||
type rpcServer struct { | ||
rpcHandler *rpc.Handler | ||
} | ||
|
||
func newRPCServer() *rpcServer { | ||
server := &rpcServer{ | ||
rpcHandler: rpc.NewHandler(), | ||
} | ||
server.rpcHandler.Register(rpc.TypeHeartbeat, server.Heartbeat) | ||
return server | ||
} | ||
|
||
func (s *rpcServer) Handler() *rpc.Handler { | ||
return s.rpcHandler | ||
} | ||
|
||
func (s *rpcServer) Heartbeat(m []byte) []byte { | ||
return m | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters