derp/derpserver: clean up extraction of derp.Server (#17264)

PR #17258 extracted `derp.Server` into `derp/derpserver.Server`.

This followup patch adds the following cleanups:
1. Rename `derp_server*.go` files to `derpserver*.go` to match
   the package name.
2. Rename the `derpserver.NewServer` constructor to `derpserver.New`
   to reduce stuttering.
3. Remove the unnecessary `derpserver.Conn` type alias.

Updates #17257
Updates #cleanup

Signed-off-by: Simon Law <sfllaw@tailscale.com>
This commit is contained in:
Simon Law
2025-09-24 10:38:30 -07:00
committed by GitHub
parent db02a46645
commit 34242df51b
12 changed files with 23 additions and 25 deletions

View File

@@ -44,7 +44,7 @@ func TestSendRecv(t *testing.T) {
clientKeys = append(clientKeys, priv.Public())
}
s := derpserver.NewServer(serverPrivateKey, t.Logf)
s := derpserver.New(serverPrivateKey, t.Logf)
defer s.Close()
httpsrv := &http.Server{
@@ -172,7 +172,7 @@ func waitConnect(t testing.TB, c *derphttp.Client) {
func TestPing(t *testing.T) {
serverPrivateKey := key.NewNode()
s := derpserver.NewServer(serverPrivateKey, t.Logf)
s := derpserver.New(serverPrivateKey, t.Logf)
defer s.Close()
httpsrv := &http.Server{
@@ -225,7 +225,7 @@ func TestPing(t *testing.T) {
const testMeshKey = "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
func newTestServer(t *testing.T, k key.NodePrivate) (serverURL string, s *derpserver.Server) {
s = derpserver.NewServer(k, t.Logf)
s = derpserver.New(k, t.Logf)
httpsrv := &http.Server{
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler)),
Handler: derpserver.Handler(s),