diff --git a/handler/handler.go b/handler/handler.go index 84d1a69..26d288d 100644 --- a/handler/handler.go +++ b/handler/handler.go @@ -4,7 +4,7 @@ import ( "context" "net" - "github.com/go-gost/core/chain" + "github.com/go-gost/core/hop" "github.com/go-gost/core/metadata" ) @@ -14,5 +14,5 @@ type Handler interface { } type Forwarder interface { - Forward(chain.Hop) + Forward(hop.Hop) } diff --git a/chain/hop.go b/hop/hop.go similarity index 72% rename from chain/hop.go rename to hop/hop.go index 4cf5a64..ddb434a 100644 --- a/chain/hop.go +++ b/hop/hop.go @@ -1,6 +1,10 @@ -package chain +package hop -import "context" +import ( + "context" + + "github.com/go-gost/core/chain" +) type SelectOptions struct { Addr string @@ -29,6 +33,9 @@ func ProtocolSelectOption(protocol string) SelectOption { } type Hop interface { - Nodes() []*Node - Select(ctx context.Context, opts ...SelectOption) *Node + Select(ctx context.Context, opts ...SelectOption) *chain.Node +} + +type NodeList interface { + Nodes() []*chain.Node }