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"
)
type ArtNetDecode struct {
type ArtNetPacketDecode struct {
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)
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)
@@ -28,15 +28,15 @@ func (ad *ArtNetDecode) Process(ctx context.Context, payload any) (any, error) {
return payloadMessage, nil
}
func (ad *ArtNetDecode) Type() string {
return ad.config.Type
func (apd *ArtNetPacketDecode) Type() string {
return apd.config.Type
}
func init() {
RegisterProcessor(ProcessorRegistration{
Type: "artnet.decode",
Type: "artnet.packet.decode",
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"
)
type ArtNetEncode struct {
type ArtNetPacketEncode struct {
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)
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()
@@ -27,15 +27,15 @@ func (ad *ArtNetEncode) Process(ctx context.Context, payload any) (any, error) {
return payloadBytes, nil
}
func (ad *ArtNetEncode) Type() string {
return ad.config.Type
func (ape *ArtNetPacketEncode) Type() string {
return ape.config.Type
}
func init() {
RegisterProcessor(ProcessorRegistration{
Type: "artnet.encode",
Type: "artnet.packet.encode",
New: func(config config.ProcessorConfig) (Processor, error) {
return &ArtNetEncode{config: config}, nil
return &ArtNetPacketEncode{config: config}, nil
},
})
}