package mqtt import ( "context" "kpt-pasture/config" "kpt-pasture/service/mqtt2" "kpt-pasture/store/kptstore" "gitee.com/xuyiping_admin/pkg/di" "go.uber.org/dig" ) var Module = di.Options(di.Provide(NewMqtt)) func NewMqtt(entry Entry) Exec { return &entry } type Entry struct { dig.In Cfg *config.AppConfig DB *kptstore.DB MqttClient mqtt2.MqttServer } type Exec interface { Subscribe(ctx context.Context, msg <-chan []byte) }