mirror of
https://github.com/jwetzell/showbridge-go.git
synced 2026-04-26 21:05:30 +00:00
change namespace
This commit is contained in:
@@ -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
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -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
|
||||
},
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user