mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-30 15:58:10 +08:00
Rename caddy2 -> caddy
Removes the version from the package name
This commit is contained in:
@ -4,12 +4,12 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/andybalholm/brotli"
|
||||
"github.com/caddyserver/caddy2"
|
||||
"github.com/caddyserver/caddy2/modules/caddyhttp/encode"
|
||||
"github.com/caddyserver/caddy"
|
||||
"github.com/caddyserver/caddy/modules/caddyhttp/encode"
|
||||
)
|
||||
|
||||
func init() {
|
||||
caddy2.RegisterModule(caddy2.Module{
|
||||
caddy.RegisterModule(caddy.Module{
|
||||
Name: "http.encoders.brotli",
|
||||
New: func() interface{} { return new(Brotli) },
|
||||
})
|
||||
@ -47,5 +47,5 @@ func (b Brotli) NewEncoder() encode.Encoder {
|
||||
// Interface guards
|
||||
var (
|
||||
_ encode.Encoding = (*Brotli)(nil)
|
||||
_ caddy2.Validator = (*Brotli)(nil)
|
||||
_ caddy.Validator = (*Brotli)(nil)
|
||||
)
|
||||
|
@ -16,12 +16,12 @@ import (
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"github.com/caddyserver/caddy2"
|
||||
"github.com/caddyserver/caddy2/modules/caddyhttp"
|
||||
"github.com/caddyserver/caddy"
|
||||
"github.com/caddyserver/caddy/modules/caddyhttp"
|
||||
)
|
||||
|
||||
func init() {
|
||||
caddy2.RegisterModule(caddy2.Module{
|
||||
caddy.RegisterModule(caddy.Module{
|
||||
Name: "http.middleware.encode",
|
||||
New: func() interface{} { return new(Encode) },
|
||||
})
|
||||
@ -39,7 +39,7 @@ type Encode struct {
|
||||
}
|
||||
|
||||
// Provision provisions enc.
|
||||
func (enc *Encode) Provision(ctx caddy2.Context) error {
|
||||
func (enc *Encode) Provision(ctx caddy.Context) error {
|
||||
enc.Encodings = make(map[string]Encoding)
|
||||
enc.writerPools = make(map[string]*sync.Pool)
|
||||
|
||||
@ -280,7 +280,7 @@ const defaultMinLength = 512
|
||||
|
||||
// Interface guards
|
||||
var (
|
||||
_ caddy2.Provisioner = (*Encode)(nil)
|
||||
_ caddy.Provisioner = (*Encode)(nil)
|
||||
_ caddyhttp.MiddlewareHandler = (*Encode)(nil)
|
||||
_ caddyhttp.HTTPInterfaces = (*responseWriter)(nil)
|
||||
)
|
||||
|
@ -5,12 +5,12 @@ import (
|
||||
"compress/gzip" // TODO: consider using https://github.com/klauspost/compress/gzip
|
||||
"fmt"
|
||||
|
||||
"github.com/caddyserver/caddy2"
|
||||
"github.com/caddyserver/caddy2/modules/caddyhttp/encode"
|
||||
"github.com/caddyserver/caddy"
|
||||
"github.com/caddyserver/caddy/modules/caddyhttp/encode"
|
||||
)
|
||||
|
||||
func init() {
|
||||
caddy2.RegisterModule(caddy2.Module{
|
||||
caddy.RegisterModule(caddy.Module{
|
||||
Name: "http.encoders.gzip",
|
||||
New: func() interface{} { return new(Gzip) },
|
||||
})
|
||||
@ -22,7 +22,7 @@ type Gzip struct {
|
||||
}
|
||||
|
||||
// Provision provisions g's configuration.
|
||||
func (g *Gzip) Provision(ctx caddy2.Context) error {
|
||||
func (g *Gzip) Provision(ctx caddy.Context) error {
|
||||
if g.Level == 0 {
|
||||
g.Level = defaultGzipLevel
|
||||
}
|
||||
@ -52,6 +52,6 @@ var defaultGzipLevel = 5
|
||||
// Interface guards
|
||||
var (
|
||||
_ encode.Encoding = (*Gzip)(nil)
|
||||
_ caddy2.Provisioner = (*Gzip)(nil)
|
||||
_ caddy2.Validator = (*Gzip)(nil)
|
||||
_ caddy.Provisioner = (*Gzip)(nil)
|
||||
_ caddy.Validator = (*Gzip)(nil)
|
||||
)
|
||||
|
@ -1,13 +1,13 @@
|
||||
package caddyzstd
|
||||
|
||||
import (
|
||||
"github.com/caddyserver/caddy2"
|
||||
"github.com/caddyserver/caddy2/modules/caddyhttp/encode"
|
||||
"github.com/caddyserver/caddy"
|
||||
"github.com/caddyserver/caddy/modules/caddyhttp/encode"
|
||||
"github.com/klauspost/compress/zstd"
|
||||
)
|
||||
|
||||
func init() {
|
||||
caddy2.RegisterModule(caddy2.Module{
|
||||
caddy.RegisterModule(caddy.Module{
|
||||
Name: "http.encoders.zstd",
|
||||
New: func() interface{} { return new(Zstd) },
|
||||
})
|
||||
|
Reference in New Issue
Block a user