github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/cmd/go/internal/modfetch/proxy.go (about)

     1  // Copyright 2018 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package modfetch
     6  
     7  import (
     8  	"github.com/shogo82148/std/cmd/go/internal/base"
     9  )
    10  
    11  var HelpGoproxy = &base.Command{
    12  	UsageLine: "goproxy",
    13  	Short:     "module proxy protocol",
    14  	Long: `
    15  A Go module proxy is any web server that can respond to GET requests for
    16  URLs of a specified form. The requests have no query parameters, so even
    17  a site serving from a fixed file system (including a file:/// URL)
    18  can be a module proxy.
    19  
    20  For details on the GOPROXY protocol, see
    21  https://golang.org/ref/mod#goproxy-protocol.
    22  `,
    23  }
    24  
    25  // TryProxies iterates f over each configured proxy (including "noproxy" and
    26  // "direct" if applicable) until f returns no error or until f returns an
    27  // error that is not equivalent to fs.ErrNotExist on a proxy configured
    28  // not to fall back on errors.
    29  //
    30  // TryProxies then returns that final error.
    31  //
    32  // If GOPROXY is set to "off", TryProxies invokes f once with the argument
    33  // "off".
    34  func TryProxies(f func(proxy string) error) error