bettercap/modules/hid/builders.go
2024-08-09 18:19:21 +02:00

35 lines
639 B
Go

package hid
import (
"github.com/bettercap/bettercap/v2/network"
)
type FrameBuilder interface {
BuildFrames(*network.HIDDevice, []*Command) error
}
var FrameBuilders = map[network.HIDType]FrameBuilder{
network.HIDTypeLogitech: LogitechBuilder{},
network.HIDTypeAmazon: AmazonBuilder{},
network.HIDTypeMicrosoft: MicrosoftBuilder{},
}
func availBuilders() []string {
return []string{
"logitech",
"amazon",
"microsoft",
}
}
func builderFromName(name string) FrameBuilder {
switch name {
case "amazon":
return AmazonBuilder{}
case "microsoft":
return MicrosoftBuilder{}
default:
return LogitechBuilder{}
}
}