add chain.Chainable interface

This commit is contained in:
ginuerzh
2021-11-23 21:44:32 +08:00
parent ece51cb0b8
commit 7beb5bf6d7
18 changed files with 125 additions and 63 deletions

View File

@ -2,12 +2,10 @@ package handler
import (
"github.com/go-gost/gost/pkg/bypass"
"github.com/go-gost/gost/pkg/chain"
"github.com/go-gost/gost/pkg/logger"
)
type Options struct {
Chain *chain.Chain
Bypass bypass.Bypass
Logger logger.Logger
}
@ -20,12 +18,6 @@ func LoggerOption(logger logger.Logger) Option {
}
}
func ChainOption(chain *chain.Chain) Option {
return func(opts *Options) {
opts.Chain = chain
}
}
func BypassOption(bypass bypass.Bypass) Option {
return func(opts *Options) {
opts.Bypass = bypass