mirror of https://github.com/goproxyio/goproxy
fix golint
parent
94fcf94f0a
commit
ead1140c92
|
@ -1,5 +1,8 @@
|
|||
# GOPROXY
|
||||
|
||||
# GOPROXY [](https://circleci.com/gh/goproxyio/goproxy)
|
||||
[](https://circleci.com/gh/goproxyio/goproxy)
|
||||
[](https://goreportcard.com/report/github.com/goproxyio/goproxy)
|
||||
[](https://godoc.org/github.com/goproxyio/goproxy)
|
||||
|
||||
A global proxy for go modules. see: [https://goproxy.io](https://goproxy.io)
|
||||
|
||||
|
|
|
@ -19,9 +19,10 @@ import (
|
|||
"github.com/goproxyio/goproxy/v2/sumdb"
|
||||
)
|
||||
|
||||
// ListExpire list data expire data duration.
|
||||
const ListExpire = 5 * time.Minute
|
||||
|
||||
// A RouterOps provides the proxy host and the external pattern
|
||||
// RouterOptions provides the proxy host and the external pattern
|
||||
type RouterOptions struct {
|
||||
Pattern string
|
||||
Proxy string
|
||||
|
@ -103,6 +104,7 @@ func NewRouter(srv *Server, opts *RouterOptions) *Router {
|
|||
return rt
|
||||
}
|
||||
|
||||
// Direct decides whether a path should directly access.
|
||||
func (rt *Router) Direct(path string) bool {
|
||||
if rt.pattern == "" {
|
||||
return false
|
||||
|
@ -153,9 +155,8 @@ func (rt *Router) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
log.Printf("------ --- %s [proxy]\n", r.URL)
|
||||
rt.proxy.ServeHTTP(w, r)
|
||||
return
|
||||
} else {
|
||||
ctype = "text/plain; charset=UTF-8"
|
||||
}
|
||||
ctype = "text/plain; charset=UTF-8"
|
||||
} else {
|
||||
ext := path.Ext(what)
|
||||
switch ext {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
// Package proxy implements the HTTP protocols for serving a Go module proxy.
|
||||
package proxy
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
// Copyright 2019 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
// Package proxy implements the HTTP protocols for serving a Go module proxy.
|
||||
|
||||
// Package sumdb implements sumdb handler proxy.
|
||||
package sumdb
|
||||
|
||||
import (
|
||||
|
|
Loading…
Reference in New Issue