docs(ax): align public api comments

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Virgil 2026-04-05 01:02:31 +00:00
parent f3c5175785
commit 3f9da136e9
3 changed files with 9 additions and 5 deletions

View file

@ -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)

View file

@ -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)

View file

@ -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