improve http vhost package

This commit is contained in:
fatedier
2017-12-13 03:27:43 +08:00
parent 63037f1c65
commit 7da61f004b
7 changed files with 586 additions and 24 deletions

View File

@@ -14,7 +14,8 @@ type VhostRouters struct {
type VhostRouter struct {
domain string
location string
listener *Listener
payload interface{}
}
func NewVhostRouters() *VhostRouters {
@@ -23,7 +24,7 @@ func NewVhostRouters() *VhostRouters {
}
}
func (r *VhostRouters) Add(domain, location string, l *Listener) {
func (r *VhostRouters) Add(domain, location string, payload interface{}) {
r.mutex.Lock()
defer r.mutex.Unlock()
@@ -35,7 +36,7 @@ func (r *VhostRouters) Add(domain, location string, l *Listener) {
vr := &VhostRouter{
domain: domain,
location: location,
listener: l,
payload: payload,
}
vrs = append(vrs, vr)