Documentation
¶
Index ¶
- Variables
- func ExternalIP() (string, error)
- func InternalIP() string
- type StringScorer
- func (ss *StringScorer) AddScore(str string)
- func (ss *StringScorer) All() iter.Seq[string]
- func (ss *StringScorer) AllWithScores() iter.Seq2[string, int]
- func (ss *StringScorer) Del(str string)
- func (ss *StringScorer) Len() int
- func (ss *StringScorer) Less(i int, j int) bool
- func (ss *StringScorer) Set(str string) *StringScorer
- func (ss *StringScorer) Swap(i int, j int)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultClient = http.Client{ Timeout: 5 * time.Second, }
Functions ¶
func ExternalIP ¶
func InternalIP ¶
func InternalIP() string
Types ¶
type StringScorer ¶
type StringScorer struct {
// contains filtered or unexported fields
}
StringScorer is used to score successful connection requests. When getting the connection array next time, it prioritizes links with higher scores.
func NewStringScorer ¶
func NewStringScorer(length int) *StringScorer
func (*StringScorer) AddScore ¶
func (ss *StringScorer) AddScore(str string)
func (*StringScorer) All ¶
func (ss *StringScorer) All() iter.Seq[string]
All returns an iterator over all strings in the scorer, ordered by score (highest first).
func (*StringScorer) AllWithScores ¶
func (ss *StringScorer) AllWithScores() iter.Seq2[string, int]
AllWithScores returns an iterator over all string-score pairs in the scorer, ordered by score (highest first).
func (*StringScorer) Del ¶
func (ss *StringScorer) Del(str string)
func (*StringScorer) Less ¶
func (ss *StringScorer) Less(i int, j int) bool
Less implements sort.Interface.
func (*StringScorer) Set ¶
func (ss *StringScorer) Set(str string) *StringScorer
func (*StringScorer) Swap ¶
func (ss *StringScorer) Swap(i int, j int)
Swap implements sort.Interface.
Click to show internal directories.
Click to hide internal directories.