diff options
| author | Michael Matloob <matloob@golang.org> | 2023-08-09 16:03:35 -0400 |
|---|---|---|
| committer | Michael Matloob <matloob@golang.org> | 2023-08-15 19:31:51 +0000 |
| commit | d3f7cf085350c6cfc1f02498391256b811d3193a (patch) | |
| tree | 9587f294b8f8190c9f45fbb5d1e6f78adfdffc81 /internal/frontend/server.go | |
| parent | 712da6878303a8938693fd1d6b14d3639f85cb64 (diff) | |
| download | go-x-pkgsite-d3f7cf085350c6cfc1f02498391256b811d3193a.tar.xz | |
internal/frontend: move urlinfo to its own package
These are also being moved so that the code in fetch.go can be moved to
a new package without depending on internal/frontend.
A couple of functions that were only used by details.go are moved to
that file.
For #61399
Change-Id: Ic299069ea0b3aaeb80dbbf7f1ed4fedf7d1787df
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/518816
Reviewed-by: Robert Findley <rfindley@google.com>
kokoro-CI: kokoro <noreply+kokoro@google.com>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'internal/frontend/server.go')
| -rw-r--r-- | internal/frontend/server.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/internal/frontend/server.go b/internal/frontend/server.go index 44f4d9be..5556cf22 100644 --- a/internal/frontend/server.go +++ b/internal/frontend/server.go @@ -28,6 +28,7 @@ import ( "golang.org/x/pkgsite/internal/experiment" pagepkg "golang.org/x/pkgsite/internal/frontend/page" "golang.org/x/pkgsite/internal/frontend/serrors" + "golang.org/x/pkgsite/internal/frontend/urlinfo" "golang.org/x/pkgsite/internal/godoc/dochtml" "golang.org/x/pkgsite/internal/licenses" "golang.org/x/pkgsite/internal/log" @@ -329,12 +330,12 @@ func detailsTTLForPath(ctx context.Context, urlPath, tab string) time.Duration { if urlPath == "/" { return defaultTTL } - info, err := parseDetailsURLPath(urlPath) + info, err := urlinfo.ParseDetailsURLPath(urlPath) if err != nil { log.Errorf(ctx, "falling back to default TTL: %v", err) return defaultTTL } - if info.requestedVersion == version.Latest { + if info.RequestedVersion == version.Latest { return shortTTL } if tab == "importedby" || tab == "versions" { |
