Reorganize RLP a bit
@@ -13,22 +13,9 @@ import (
"google.golang.org/grpc"
)
-func NewRLP(opts ...RLPOption) *RLP {
- rlp := &RLP{
- ingressAddrs: []string{"doppler.service.cf.internal"},
- ingressDialOpts: []grpc.DialOption{grpc.WithInsecure()},
- egressServerOpts: []grpc.ServerOption{},
- }
- for _, o := range opts {
- o(rlp)
- }
- return rlp
-}
-
// RLP represents a running reverse log proxy. It connects to various gRPC
// servers to ingress data and opens a gRPC server to egress data.
type RLP struct {
- egressAddr net.Addr
egressPort int
egressServerOpts []grpc.ServerOption
@@ -37,10 +24,24 @@ type RLP struct {
receiver *ingress.Receiver
+ egressAddr net.Addr
egressListener net.Listener
egressServer *grpc.Server
}
+// NewRLP returns a new unstarted RLP.
+func NewRLP(opts ...RLPOption) *RLP {
+ rlp := &RLP{
+ ingressAddrs: []string{"doppler.service.cf.internal"},
+ ingressDialOpts: []grpc.DialOption{grpc.WithInsecure()},
+ egressServerOpts: []grpc.ServerOption{},
+ }
+ for _, o := range opts {
+ o(rlp)
+ }
+ return rlp
+}
+
// RLPOption represents a function that can configure a remote log proxy.
type RLPOption func(c *RLP)
