add chain hop
This commit is contained in:
20
chain/hop.go
Normal file
20
chain/hop.go
Normal file
@ -0,0 +1,20 @@
|
||||
package chain
|
||||
|
||||
import "context"
|
||||
|
||||
type SelectOptions struct {
|
||||
Addr string
|
||||
}
|
||||
|
||||
type SelectOption func(*SelectOptions)
|
||||
|
||||
func AddrSelectOption(addr string) SelectOption {
|
||||
return func(o *SelectOptions) {
|
||||
o.Addr = addr
|
||||
}
|
||||
}
|
||||
|
||||
type Hop interface {
|
||||
Nodes() []*Node
|
||||
Select(ctx context.Context, opts ...SelectOption) *Node
|
||||
}
|
Reference in New Issue
Block a user