diff options
author | tjpcc <tjp@ctrl-c.club> | 2023-08-12 09:40:39 -0600 |
---|---|---|
committer | tjpcc <tjp@ctrl-c.club> | 2023-08-12 09:40:39 -0600 |
commit | 23bc5f4fb7542e64c94eaa7fe2c7a6aa55010898 (patch) | |
tree | ec8113d3aa2379e3ca9cb3c6e13a5531895ea8c0 /gemini/request.go | |
parent | 57a31a9b2cd549174d839b9b91b47db337f174cc (diff) |
move common types to an internal package
This helps avoid import cycles.
Diffstat (limited to 'gemini/request.go')
-rw-r--r-- | gemini/request.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gemini/request.go b/gemini/request.go index 51aaae5..4eb7cf0 100644 --- a/gemini/request.go +++ b/gemini/request.go @@ -6,7 +6,7 @@ import ( "io" "net/url" - sr "tildegit.org/tjp/sliderule" + "tildegit.org/tjp/sliderule/internal/types" ) // InvalidRequestLineEnding indicates that a gemini request didn't end with "\r\n". @@ -15,7 +15,7 @@ var InvalidRequestLineEnding = errors.New("invalid request line ending") // ParseRequest parses a single gemini request from a reader. // // If the reader argument is a *bufio.Reader, it will only read a single line from it. -func ParseRequest(rdr io.Reader) (*sr.Request, error) { +func ParseRequest(rdr io.Reader) (*types.Request, error) { bufrdr, ok := rdr.(*bufio.Reader) if !ok { bufrdr = bufio.NewReader(rdr) @@ -39,14 +39,14 @@ func ParseRequest(rdr io.Reader) (*sr.Request, error) { u.Scheme = "gemini" } - return &sr.Request{URL: u}, nil + return &types.Request{URL: u}, nil } // GetTitanRequestBody fetches the request body from a titan request. // // It returns nil if the argument is not a titan request or it otherwise // does not have a request body set. -func GetTitanRequestBody(request *sr.Request) io.Reader { +func GetTitanRequestBody(request *types.Request) io.Reader { if request.Scheme != "titan" { return nil } |