Ejemplo n.º 1
0
func (this *CompositeReaderBuilder) RegisterMultiple(prefix string, instances ...interface{}) *CompositeReaderBuilder {
	discovery := messaging.NewReflectionDiscovery(prefix)

	for _, instance := range instances {
		if discovered, err := discovery.Discover(instance); err != nil {
			log.Fatal("Unable to discover type for instance", instance)
		} else {
			this.types[discovered] = reflect.TypeOf(instance)
			this.addBinding(discovered)
		}
	}

	return this
}
Ejemplo n.º 2
0
func (this *CompositeWriterBuilder) PrefixTypesWith(prefix string) *CompositeWriterBuilder {
	this.discovery = messaging.NewReflectionDiscovery(prefix)
	return this
}