This commit is contained in:
ginuerzh
2021-11-15 12:55:05 +08:00
parent 3fe5084629
commit ce3d62759a
38 changed files with 788 additions and 291 deletions

View File

@ -1,11 +1,13 @@
package listener
import (
"github.com/go-gost/gost/pkg/chain"
"github.com/go-gost/gost/pkg/logger"
)
type Options struct {
Addr string
Chain *chain.Chain
Logger logger.Logger
}
@ -17,6 +19,12 @@ func AddrOption(addr string) Option {
}
}
func ChainOption(chain *chain.Chain) Option {
return func(opts *Options) {
opts.Chain = chain
}
}
func LoggerOption(logger logger.Logger) Option {
return func(opts *Options) {
opts.Logger = logger