change namespace

This commit is contained in:
Joel Wetzell
2025-12-24 15:28:25 -06:00
parent 407f1f3618
commit 58cb7766fe
2 changed files with 14 additions and 14 deletions

View File

@@ -8,15 +8,15 @@ import (
"github.com/jwetzell/showbridge-go/internal/config" "github.com/jwetzell/showbridge-go/internal/config"
) )
type ArtNetDecode struct { type ArtNetPacketDecode struct {
config config.ProcessorConfig config config.ProcessorConfig
} }
func (ad *ArtNetDecode) Process(ctx context.Context, payload any) (any, error) { func (apd *ArtNetPacketDecode) Process(ctx context.Context, payload any) (any, error) {
payloadBytes, ok := payload.([]byte) payloadBytes, ok := payload.([]byte)
if !ok { if !ok {
return nil, fmt.Errorf("artnet.decode processor only accepts a []byte") return nil, fmt.Errorf("artnet.packet.decode processor only accepts a []byte")
} }
payloadMessage, err := artnet.Decode(payloadBytes) payloadMessage, err := artnet.Decode(payloadBytes)
@@ -28,15 +28,15 @@ func (ad *ArtNetDecode) Process(ctx context.Context, payload any) (any, error) {
return payloadMessage, nil return payloadMessage, nil
} }
func (ad *ArtNetDecode) Type() string { func (apd *ArtNetPacketDecode) Type() string {
return ad.config.Type return apd.config.Type
} }
func init() { func init() {
RegisterProcessor(ProcessorRegistration{ RegisterProcessor(ProcessorRegistration{
Type: "artnet.decode", Type: "artnet.packet.decode",
New: func(config config.ProcessorConfig) (Processor, error) { New: func(config config.ProcessorConfig) (Processor, error) {
return &ArtNetDecode{config: config}, nil return &ArtNetPacketDecode{config: config}, nil
}, },
}) })
} }

View File

@@ -8,15 +8,15 @@ import (
"github.com/jwetzell/showbridge-go/internal/config" "github.com/jwetzell/showbridge-go/internal/config"
) )
type ArtNetEncode struct { type ArtNetPacketEncode struct {
config config.ProcessorConfig config config.ProcessorConfig
} }
func (ad *ArtNetEncode) Process(ctx context.Context, payload any) (any, error) { func (ape *ArtNetPacketEncode) Process(ctx context.Context, payload any) (any, error) {
payloadPacket, ok := payload.(artnet.ArtNetPacket) payloadPacket, ok := payload.(artnet.ArtNetPacket)
if !ok { if !ok {
return nil, fmt.Errorf("artnet.encode processor only accepts an ArtNetPacket") return nil, fmt.Errorf("artnet.packet.encode processor only accepts an ArtNetPacket")
} }
payloadBytes, err := payloadPacket.MarshalBinary() payloadBytes, err := payloadPacket.MarshalBinary()
@@ -27,15 +27,15 @@ func (ad *ArtNetEncode) Process(ctx context.Context, payload any) (any, error) {
return payloadBytes, nil return payloadBytes, nil
} }
func (ad *ArtNetEncode) Type() string { func (ape *ArtNetPacketEncode) Type() string {
return ad.config.Type return ape.config.Type
} }
func init() { func init() {
RegisterProcessor(ProcessorRegistration{ RegisterProcessor(ProcessorRegistration{
Type: "artnet.encode", Type: "artnet.packet.encode",
New: func(config config.ProcessorConfig) (Processor, error) { New: func(config config.ProcessorConfig) (Processor, error) {
return &ArtNetEncode{config: config}, nil return &ArtNetPacketEncode{config: config}, nil
}, },
}) })
} }