caddy/caddyhttp/push/push.go

31 lines
486 B
Go
Raw Normal View History

package push
import (
"net/http"
"github.com/mholt/caddy/caddyhttp/httpserver"
)
type (
// Rule describes conditions on which resources will be pushed
Rule struct {
Path string
Resources []Resource
}
// Resource describes resource to be pushed
Resource struct {
Path string
Method string
Header http.Header
}
// Middleware supports pushing resources to clients
Middleware struct {
Next httpserver.Handler
Rules []Rule
}
ruleOp func([]Resource)
)