go.mod: Append /v2 to module name; update all import paths

See https://github.com/golang/go/wiki/Modules#semantic-import-versioning
This commit is contained in:
Matthew Holt 2019-07-02 12:37:06 -06:00
parent 94c28a2574
commit fdd871e177
No known key found for this signature in database
GPG Key ID: 2A349DD577D586A5
41 changed files with 72 additions and 72 deletions

View File

@ -199,7 +199,7 @@ func GoModule() *debug.Module {
} }
// goModule is the name of this Go module. // goModule is the name of this Go module.
const goModule = "github.com/mholt/caddy" const goModule = "github.com/caddyserver/caddy/v2"
// CtxKey is a value type for use with context.WithValue. // CtxKey is a value type for use with context.WithValue.
type CtxKey string type CtxKey string

View File

@ -15,23 +15,23 @@
package main package main
import ( import (
caddycmd "github.com/caddyserver/caddy/cmd" caddycmd "github.com/caddyserver/caddy/v2/cmd"
// this is where modules get plugged in // this is where modules get plugged in
_ "github.com/caddyserver/caddy/modules/caddyhttp" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp"
_ "github.com/caddyserver/caddy/modules/caddyhttp/encode" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode"
_ "github.com/caddyserver/caddy/modules/caddyhttp/encode/brotli" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/brotli"
_ "github.com/caddyserver/caddy/modules/caddyhttp/encode/gzip" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/gzip"
_ "github.com/caddyserver/caddy/modules/caddyhttp/encode/zstd" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode/zstd"
_ "github.com/caddyserver/caddy/modules/caddyhttp/fileserver" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/fileserver"
_ "github.com/caddyserver/caddy/modules/caddyhttp/headers" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/headers"
_ "github.com/caddyserver/caddy/modules/caddyhttp/markdown" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/markdown"
_ "github.com/caddyserver/caddy/modules/caddyhttp/requestbody" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/requestbody"
_ "github.com/caddyserver/caddy/modules/caddyhttp/reverseproxy" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/reverseproxy"
_ "github.com/caddyserver/caddy/modules/caddyhttp/rewrite" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/rewrite"
_ "github.com/caddyserver/caddy/modules/caddyhttp/templates" _ "github.com/caddyserver/caddy/v2/modules/caddyhttp/templates"
_ "github.com/caddyserver/caddy/modules/caddytls" _ "github.com/caddyserver/caddy/v2/modules/caddytls"
_ "github.com/caddyserver/caddy/modules/caddytls/standardstek" _ "github.com/caddyserver/caddy/v2/modules/caddytls/standardstek"
) )
func main() { func main() {

View File

@ -26,7 +26,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/mholt/certmagic" "github.com/mholt/certmagic"
"github.com/mitchellh/go-ps" "github.com/mitchellh/go-ps"
) )

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/caddyserver/caddy module github.com/caddyserver/caddy/v2
go 1.12 go 1.12

View File

@ -26,8 +26,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddytls" "github.com/caddyserver/caddy/v2/modules/caddytls"
"github.com/mholt/certmagic" "github.com/mholt/certmagic"
) )

View File

@ -19,8 +19,8 @@ import (
"net/http" "net/http"
"time" "time"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -18,8 +18,8 @@ import (
"fmt" "fmt"
"github.com/andybalholm/brotli" "github.com/andybalholm/brotli"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp/encode" "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode"
) )
func init() { func init() {

View File

@ -30,8 +30,8 @@ import (
"strings" "strings"
"sync" "sync"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -19,8 +19,8 @@ import (
"compress/gzip" // TODO: consider using https://github.com/klauspost/compress/gzip "compress/gzip" // TODO: consider using https://github.com/klauspost/compress/gzip
"fmt" "fmt"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp/encode" "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode"
) )
func init() { func init() {

View File

@ -15,8 +15,8 @@
package caddyzstd package caddyzstd
import ( import (
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp/encode" "github.com/caddyserver/caddy/v2/modules/caddyhttp/encode"
"github.com/klauspost/compress/zstd" "github.com/klauspost/compress/zstd"
) )

View File

@ -21,7 +21,7 @@ import (
"runtime" "runtime"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
// Error is a convenient way for a Handler to populate the // Error is a convenient way for a Handler to populate the

View File

@ -23,8 +23,8 @@ import (
"path" "path"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
// Browse configures directory browsing. // Browse configures directory browsing.

View File

@ -23,7 +23,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/dustin/go-humanize" "github.com/dustin/go-humanize"
) )

View File

@ -18,8 +18,8 @@ import (
"net/http" "net/http"
"os" "os"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -27,8 +27,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -18,8 +18,8 @@ import (
"net/http" "net/http"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -23,8 +23,8 @@ import (
"gopkg.in/russross/blackfriday.v2" "gopkg.in/russross/blackfriday.v2"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -27,8 +27,8 @@ import (
"regexp" "regexp"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/pkg/caddyscript" "github.com/caddyserver/caddy/v2/pkg/caddyscript"
"go.starlark.net/starlark" "go.starlark.net/starlark"
) )

View File

@ -22,7 +22,7 @@ import (
"net/url" "net/url"
"testing" "testing"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
func TestHostMatcher(t *testing.T) { func TestHostMatcher(t *testing.T) {

View File

@ -21,7 +21,7 @@ import (
"path" "path"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
// TODO: A simple way to format or escape or encode each value would be nice // TODO: A simple way to format or escape or encode each value would be nice

View File

@ -17,8 +17,8 @@ package requestbody
import ( import (
"net/http" "net/http"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -15,7 +15,7 @@
package reverseproxy package reverseproxy
import ( import (
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
// Register caddy module. // Register caddy module.

View File

@ -28,7 +28,7 @@ import (
"sync/atomic" "sync/atomic"
"time" "time"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
// CircuitBreaker defines the functionality of a circuit breaker module. // CircuitBreaker defines the functionality of a circuit breaker module.

View File

@ -19,8 +19,8 @@ import (
"net/url" "net/url"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -19,7 +19,7 @@ import (
"fmt" "fmt"
"net/http" "net/http"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
// ServerRoute represents a set of matching rules, // ServerRoute represents a set of matching rules,

View File

@ -23,8 +23,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddytls" "github.com/caddyserver/caddy/v2/modules/caddytls"
) )
// Server is an HTTP server. // Server is an HTTP server.

View File

@ -19,7 +19,7 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
func init() { func init() {

View File

@ -21,7 +21,7 @@ import (
"net/http/httptest" "net/http/httptest"
"testing" "testing"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
func TestStaticResponseHandler(t *testing.T) { func TestStaticResponseHandler(t *testing.T) {

View File

@ -17,7 +17,7 @@ package caddyhttp
import ( import (
"net/http" "net/http"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
func init() { func init() {

View File

@ -22,8 +22,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
) )
func init() { func init() {

View File

@ -26,7 +26,7 @@ import (
"sync" "sync"
"github.com/Masterminds/sprig" "github.com/Masterminds/sprig"
"github.com/caddyserver/caddy/modules/caddyhttp" "github.com/caddyserver/caddy/v2/modules/caddyhttp"
"gopkg.in/russross/blackfriday.v2" "gopkg.in/russross/blackfriday.v2"
) )

View File

@ -22,7 +22,7 @@ import (
"github.com/go-acme/lego/certcrypto" "github.com/go-acme/lego/certcrypto"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/go-acme/lego/challenge" "github.com/go-acme/lego/challenge"
"github.com/mholt/certmagic" "github.com/mholt/certmagic"
) )

View File

@ -21,7 +21,7 @@ import (
"fmt" "fmt"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/go-acme/lego/challenge/tlsalpn01" "github.com/go-acme/lego/challenge/tlsalpn01"
"github.com/mholt/certmagic" "github.com/mholt/certmagic"
) )

View File

@ -19,7 +19,7 @@ import (
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
func init() { func init() {

View File

@ -24,7 +24,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
func init() { func init() {

View File

@ -17,7 +17,7 @@ package caddytls
import ( import (
"crypto/tls" "crypto/tls"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
// MatchServerName matches based on SNI. // MatchServerName matches based on SNI.

View File

@ -23,7 +23,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
) )
// SessionTicketService configures and manages TLS session tickets. // SessionTicketService configures and manages TLS session tickets.

View File

@ -19,8 +19,8 @@ import (
"sync" "sync"
"time" "time"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/modules/caddytls" "github.com/caddyserver/caddy/v2/modules/caddytls"
) )
func init() { func init() {

View File

@ -23,7 +23,7 @@ import (
"os" "os"
"time" "time"
"github.com/caddyserver/caddy" "github.com/caddyserver/caddy/v2"
"github.com/go-acme/lego/challenge" "github.com/go-acme/lego/challenge"
"github.com/mholt/certmagic" "github.com/mholt/certmagic"
"golang.org/x/time/rate" "golang.org/x/time/rate"

View File

@ -69,7 +69,7 @@ var defaultCipherSuitesWithoutAESNI = []uint16{
// getOptimalDefaultCipherSuites returns an appropriate cipher // getOptimalDefaultCipherSuites returns an appropriate cipher
// suite to use depending on the hardware support for AES. // suite to use depending on the hardware support for AES.
// //
// See https://github.com/mholt/caddy/issues/1674 // See https://github.com/caddyserver/caddy/issues/1674
func getOptimalDefaultCipherSuites() []uint16 { func getOptimalDefaultCipherSuites() []uint16 {
if cpuid.CPU.AesNi() { if cpuid.CPU.AesNi() {
return defaultCipherSuitesWithAESNI return defaultCipherSuitesWithAESNI

View File

@ -17,7 +17,7 @@ package caddyscript
import ( import (
"net/http" "net/http"
caddyscript "github.com/caddyserver/caddy/pkg/caddyscript/lib" caddyscript "github.com/caddyserver/caddy/v2/pkg/caddyscript/lib"
"go.starlark.net/starlark" "go.starlark.net/starlark"
) )