package mqtt

import "context"

type MQTTClient interface {
	Publish(ctx context.Context, topic string, payload interface{}) error
	Subscribe(topic string, handler func(payload interface{})) error
}

var clients = make(map[string]MQTTClient)

func RegisterClient(name string, client MQTTClient) {
	clients[name] = client
}

func GetMQTTClient(name string) MQTTClient {
	return clients[name]
}
