move hop out of chain
This commit is contained in:
parent
6d0e88635b
commit
b0bd45c1b8
@ -4,7 +4,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"net"
|
"net"
|
||||||
|
|
||||||
"github.com/go-gost/core/chain"
|
"github.com/go-gost/core/hop"
|
||||||
"github.com/go-gost/core/metadata"
|
"github.com/go-gost/core/metadata"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -14,5 +14,5 @@ type Handler interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Forwarder interface {
|
type Forwarder interface {
|
||||||
Forward(chain.Hop)
|
Forward(hop.Hop)
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
package chain
|
package hop
|
||||||
|
|
||||||
import "context"
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"github.com/go-gost/core/chain"
|
||||||
|
)
|
||||||
|
|
||||||
type SelectOptions struct {
|
type SelectOptions struct {
|
||||||
Addr string
|
Addr string
|
||||||
@ -29,6 +33,9 @@ func ProtocolSelectOption(protocol string) SelectOption {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Hop interface {
|
type Hop interface {
|
||||||
Nodes() []*Node
|
Select(ctx context.Context, opts ...SelectOption) *chain.Node
|
||||||
Select(ctx context.Context, opts ...SelectOption) *Node
|
}
|
||||||
|
|
||||||
|
type NodeList interface {
|
||||||
|
Nodes() []*chain.Node
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user