From 23bc5f4fb7542e64c94eaa7fe2c7a6aa55010898 Mon Sep 17 00:00:00 2001 From: tjpcc Date: Sat, 12 Aug 2023 09:40:39 -0600 Subject: move common types to an internal package This helps avoid import cycles. --- gopher/serve.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gopher/serve.go') diff --git a/gopher/serve.go b/gopher/serve.go index 7b32f2f..56b38f6 100644 --- a/gopher/serve.go +++ b/gopher/serve.go @@ -7,14 +7,14 @@ import ( "io" "net" - sr "tildegit.org/tjp/sliderule" + "tildegit.org/tjp/sliderule/internal/types" "tildegit.org/tjp/sliderule/internal" "tildegit.org/tjp/sliderule/logging" ) type gopherServer struct { internal.Server - handler sr.Handler + handler types.Handler } func (gs gopherServer) Protocol() string { return "GOPHER" } @@ -25,9 +25,9 @@ func NewServer( hostname string, network string, address string, - handler sr.Handler, + handler types.Handler, errLog logging.Logger, -) (sr.Server, error) { +) (types.Server, error) { gs := &gopherServer{handler: handler} hostname = internal.JoinDefaultPort(hostname, "70") @@ -43,7 +43,7 @@ func NewServer( } func (gs *gopherServer) handleConn(conn net.Conn) { - var response *sr.Response + var response *types.Response request, err := ParseRequest(conn) if err != nil { response = Error(errors.New("Malformed request.")).Response() -- cgit v1.2.3