add convenience method for casting payloads

This commit is contained in:
Joel Wetzell
2026-03-02 12:06:42 -06:00
parent af39c16f30
commit df14024012
38 changed files with 54 additions and 40 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/jwetzell/showbridge-go/internal/config"
"github.com/jwetzell/showbridge-go/internal/framer"
"github.com/jwetzell/showbridge-go/internal/processor"
"github.com/jwetzell/showbridge-go/internal/route"
)
@@ -152,7 +153,7 @@ func (tc *TCPClient) Output(ctx context.Context, payload any) error {
return err
}
}
payloadBytes, ok := payload.([]byte)
payloadBytes, ok := processor.GetAnyAs[[]byte](payload)
if !ok {
return errors.New("net.tcp.client is only able to output bytes")
}