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

@ -4,7 +4,6 @@ import (
"errors"
"net"
"github.com/go-gost/gost/pkg/chain"
"github.com/go-gost/gost/pkg/metadata"
)
@ -22,7 +21,3 @@ type Listener interface {
type Accepter interface {
Accept() (net.Conn, error)
}
type Chainable interface {
Chain(chain *chain.Chain)
}

View File

@ -38,8 +38,8 @@ func NewListener(opts ...listener.Option) listener.Listener {
}
}
// implements listener.Chainable interface
func (l *rtcpListener) Chain(chain *chain.Chain) {
// implements chain.Chainable interface
func (l *rtcpListener) WithChain(chain *chain.Chain) {
l.chain = chain
}

View File

@ -38,8 +38,8 @@ func NewListener(opts ...listener.Option) listener.Listener {
}
}
// implements listener.Chainable interface
func (l *rudpListener) Chain(chain *chain.Chain) {
// implements chain.Chainable interface
func (l *rudpListener) WithChain(chain *chain.Chain) {
l.chain = chain
}