diff --git a/api/router.go b/api/router.go index 5076caa..f4023ad 100644 --- a/api/router.go +++ b/api/router.go @@ -1,4 +1,4 @@ -// Package api registers the monitoring routes on an HTTP mux. +// Package api mounts the three monitoring endpoints on an HTTP mux. // // mux := http.NewServeMux() // api.RegisterRoutes(mux, p) diff --git a/pool/impl.go b/pool/impl.go index 0f2cbb1..9dd20de 100644 --- a/pool/impl.go +++ b/pool/impl.go @@ -18,6 +18,9 @@ import ( ) // NewStrategyFactory creates a StrategyFactory for the supplied config. +// +// factory := pool.NewStrategyFactory(cfg) +// strategy := factory(listener) func NewStrategyFactory(config *proxy.Config) StrategyFactory { return func(listener StratumListener) Strategy { return NewFailoverStrategy(config.Pools, listener, config) diff --git a/pool/strategy.go b/pool/strategy.go index c3a36a1..4cd39d0 100644 --- a/pool/strategy.go +++ b/pool/strategy.go @@ -22,14 +22,15 @@ type FailoverStrategy struct { mu sync.Mutex } -// StrategyFactory creates a new FailoverStrategy for a given StratumListener. -// Used by splitters to create per-mapper strategies without coupling to Config. +// StrategyFactory creates a FailoverStrategy for a given StratumListener. +// Splitters use it to create one upstream strategy per mapper without importing +// the pool wiring directly. // // factory := pool.NewStrategyFactory(cfg) -// strategy := factory(listener) // each mapper calls this +// strategy := factory(listener) type StrategyFactory func(listener StratumListener) Strategy -// Strategy is the interface the splitters use to submit shares and check pool state. +// Strategy is the interface splitters use to submit shares and inspect pool state. type Strategy interface { Connect() Submit(jobID, nonce, result, algo string) int64