Documentation ¶
Index ¶
- Constants
- Variables
- type DialerGroup
- func (g *DialerGroup) Close() error
- func (g *DialerGroup) GetSelectionPolicy() (policy consts.DialerSelectionPolicy)
- func (d *DialerGroup) MustGetAliveDialerSet(typ *dialer.NetworkType) *dialer.AliveDialerSet
- func (g *DialerGroup) Select(networkType *dialer.NetworkType, strictIpVersion bool) (d *dialer.Dialer, latency time.Duration, err error)
- func (g *DialerGroup) SetSelectionPolicy(policy DialerSelectionPolicy)
- type DialerSelectionPolicy
- type DialerSet
Constants ¶
View Source
const ( FilterInput_Name = "name" FilterInput_SubscriptionTag = "subtag" FilterInput_Link = "link" )
View Source
const ( FilterKey_Name_Regex = "regex" FilterKey_Name_Keyword = "keyword" FilterInput_SubscriptionTag_Regex = "regex" )
Variables ¶
View Source
var ErrNoAliveDialer = fmt.Errorf("no alive dialer")
Functions ¶
This section is empty.
Types ¶
type DialerGroup ¶
type DialerGroup struct { netproxy.Dialer Name string Dialers []*dialer.Dialer // contains filtered or unexported fields }
func NewDialerGroup ¶
func NewDialerGroup( option *dialer.GlobalOption, name string, dialers []*dialer.Dialer, dialersAnnotations []*dialer.Annotation, p DialerSelectionPolicy, aliveChangeCallback func(alive bool, networkType *dialer.NetworkType, isInit bool), ) *DialerGroup
func (*DialerGroup) Close ¶
func (g *DialerGroup) Close() error
func (*DialerGroup) GetSelectionPolicy ¶
func (g *DialerGroup) GetSelectionPolicy() (policy consts.DialerSelectionPolicy)
func (*DialerGroup) MustGetAliveDialerSet ¶
func (d *DialerGroup) MustGetAliveDialerSet(typ *dialer.NetworkType) *dialer.AliveDialerSet
func (*DialerGroup) Select ¶
func (g *DialerGroup) Select(networkType *dialer.NetworkType, strictIpVersion bool) (d *dialer.Dialer, latency time.Duration, err error)
Select selects a dialer from group according to selectionPolicy. If 'strictIpVersion' is false and no alive dialer, it will fallback to another ipversion.
func (*DialerGroup) SetSelectionPolicy ¶
func (g *DialerGroup) SetSelectionPolicy(policy DialerSelectionPolicy)
type DialerSelectionPolicy ¶
type DialerSelectionPolicy struct { Policy consts.DialerSelectionPolicy FixedIndex int }
func NewDialerSelectionPolicyFromGroupParam ¶
func NewDialerSelectionPolicyFromGroupParam(param *config.Group) (policy *DialerSelectionPolicy, err error)
type DialerSet ¶
type DialerSet struct {
// contains filtered or unexported fields
}
func NewDialerSetFromLinks ¶
func NewDialerSetFromLinks(option *dialer.GlobalOption, tagToNodeList map[string][]string) *DialerSet
func (*DialerSet) FilterAndAnnotate ¶ added in v0.2.2
func (s *DialerSet) FilterAndAnnotate(filters [][]*config_parser.Function, annotations [][]*config_parser.Param) (dialers []*dialer.Dialer, filterAnnotations []*dialer.Annotation, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.