@@ -95,16 +95,16 @@ func equals(want string) Matcher {
9595// config contains the proxying state for one listener.
9696type config struct {
9797 sync.Mutex // protect w of routes
98- nextRouteId int
98+ nextRouteID int
9999 routes map [int ]route
100100 acmeTargets []Target // accumulates targets that should be probed for acme.
101101 stopACME bool // if true, AddSNIRoute doesn't add targets to acmeTargets.
102102}
103103
104- func NewConfig () (cfg * config ) {
104+ func newConfig () (cfg * config ) {
105105 cfg = & config {}
106106 cfg .routes = make (map [int ]route )
107- cfg .nextRouteId = 1
107+ cfg .nextRouteID = 1
108108 return
109109}
110110
@@ -132,12 +132,12 @@ func (p *Proxy) configFor(ipPort string) *config {
132132 p .configs = make (map [string ]* config )
133133 }
134134 if p .configs [ipPort ] == nil {
135- p .configs [ipPort ] = NewConfig ()
135+ p .configs [ipPort ] = newConfig ()
136136 }
137137 return p .configs [ipPort ]
138138}
139139
140- func (p * Proxy ) addRoute (ipPort string , r route ) (routeId int ) {
140+ func (p * Proxy ) addRoute (ipPort string , r route ) (routeID int ) {
141141 var cfg * config
142142 if p .donec != nil {
143143 // NOTE: Do not create config file if the server is listening.
@@ -149,33 +149,33 @@ func (p *Proxy) addRoute(ipPort string, r route) (routeId int) {
149149 }
150150 if cfg != nil {
151151 cfg .Lock ()
152- routeId = cfg .nextRouteId
153- cfg .nextRouteId ++
154- cfg .routes [routeId ] = r
152+ routeID = cfg .nextRouteID
153+ cfg .nextRouteID ++
154+ cfg .routes [routeID ] = r
155155 cfg .Unlock ()
156156 }
157157 return
158158}
159159
160160// AddRoute appends an always-matching route to the ipPort listener,
161161// directing any connection to dest. The added route's id is returned
162- // for future removal. If routeId is zero, the route is not registered.
162+ // for future removal. If routeID is zero, the route is not registered.
163163//
164164// This is generally used as either the only rule (for simple TCP
165165// proxies), or as the final fallback rule for an ipPort.
166166//
167167// The ipPort is any valid net.Listen TCP address.
168- func (p * Proxy ) AddRoute (ipPort string , dest Target ) (routeId int ) {
168+ func (p * Proxy ) AddRoute (ipPort string , dest Target ) (routeID int ) {
169169 return p .addRoute (ipPort , fixedTarget {dest })
170170}
171171
172172// RemoveRoute removes an existing route for ipPort. If the route is
173173// not found, this is an no-op.
174174//
175175// Both AddRoute and RemoveRoute is go-routine safe.
176- func (p * Proxy ) RemoveRoute (ipPort string , routeId int ) (err error ) {
176+ func (p * Proxy ) RemoveRoute (ipPort string , routeID int ) (err error ) {
177177 cfg := p .configFor (ipPort )
178- cfg .routes [routeId ] = nil
178+ cfg .routes [routeID ] = nil
179179 return
180180}
181181
0 commit comments