docs: add godoc comments to all exported functions and methods

This commit is contained in:
adman
2026-07-30 00:20:55 +02:00
parent 56c97a2b3f
commit 0d6b6e1ab9
50 changed files with 186 additions and 408 deletions
+3
View File
@@ -69,6 +69,8 @@ var WhileClosingErr = errors.New("error while closing")
var ContextDoneErr = errors.New("context done")
var RecvNotOkErr = errors.New("recv not ok")
// ValidateHandler validates that h is a function taking a single argument and returning an error.
// It panics if the handler does not match the expected signature.
func ValidateHandler(h any) (eventType reflect.Type, hv reflect.Value) {
hv = reflect.ValueOf(h)
if hv.Kind() != reflect.Func {
@@ -235,6 +237,7 @@ func (l *Loop) StartLoop() (err error) {
return
}
// NewLoop creates a new Loop with a background context.
func NewLoop() (l *Loop) {
return NewLoopCtx(context.Background())
}