docs(parsing): add package and symbol doc comments

Add godoc comments for all 62 exported symbols across 20 files in
config/parsing/: 23 MDKey constants, 35 Parse*/List/Default* functions,
3 TLS helpers, 1 Args struct with 7 fields, and the package doc.
This commit is contained in:
ginuerzh
2026-05-24 13:58:37 +08:00
parent 2b1e4ca3a7
commit effba3b690
20 changed files with 203 additions and 21 deletions
+10
View File
@@ -7,6 +7,9 @@ import (
xs "github.com/go-gost/x/selector"
)
// ParseChainSelector creates a chain-level selector from a SelectorConfig. If
// cfg is nil it returns nil. Strategy defaults to round-robin when unrecognized
// or unset.
func ParseChainSelector(cfg *config.SelectorConfig) selector.Selector[chain.Chainer] {
if cfg == nil {
return nil
@@ -32,6 +35,9 @@ func ParseChainSelector(cfg *config.SelectorConfig) selector.Selector[chain.Chai
)
}
// ParseNodeSelector creates a node-level selector from a SelectorConfig. If
// cfg is nil it returns nil. Supported strategies: round/rr, random/rand,
// fifo/ha, hash, and parallel. Defaults to round-robin.
func ParseNodeSelector(cfg *config.SelectorConfig) selector.Selector[*chain.Node] {
if cfg == nil {
return nil
@@ -60,6 +66,8 @@ func ParseNodeSelector(cfg *config.SelectorConfig) selector.Selector[*chain.Node
)
}
// DefaultNodeSelector returns a node selector using round-robin strategy with
// default fail filter settings.
func DefaultNodeSelector() selector.Selector[*chain.Node] {
return xs.NewSelector(
xs.RoundRobinStrategy[*chain.Node](),
@@ -68,6 +76,8 @@ func DefaultNodeSelector() selector.Selector[*chain.Node] {
)
}
// DefaultChainSelector returns a chain selector using round-robin strategy
// with default fail filter settings.
func DefaultChainSelector() selector.Selector[chain.Chainer] {
return xs.NewSelector(
xs.RoundRobinStrategy[chain.Chainer](),