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

@@ -8,6 +8,7 @@ import (
"time"
"github.com/jwetzell/showbridge-go/internal/config"
"github.com/jwetzell/showbridge-go/internal/processor"
"github.com/jwetzell/showbridge-go/internal/route"
)
@@ -61,7 +62,7 @@ func (hc *HTTPClient) Start(ctx context.Context) error {
func (hc *HTTPClient) Output(ctx context.Context, payload any) error {
payloadRequest, ok := payload.(*http.Request)
payloadRequest, ok := processor.GetAnyAs[*http.Request](payload)
if !ok {
return errors.New("http.client is only able to output an http.Request")