* PoC: memory registry using maps instead of slice madness
* Updated proto and handlers. Fixed tests across codebase.
* Implemented ttl pruning for memory registry
* Added extensive memory registry tests
* Squased a bunch of bugs
* Proto indent; memory.Registry.String() returns "memory"
* Write a test to prove memory registry TTLs are busted
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
* Additional memory testing and fixups:
* DefaultTTL removed
* When TTL == 0, it is automatically removed from expiry conditions
* Additional improvements to new tests
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
fixing test failed issue
change back error type
change registry.ErrNotFound back to selector.ErrNotFound
change back error type
change registry.ErrNotFound back to selector.ErrNotFound
remove the single node tunnel test
Fix read yaml config from memory
package main
import (
"fmt"
"github.com/micro/go-micro/config"
"github.com/micro/go-micro/config/source/memory"
)
var configData = []byte(`
---
a: 1234
`)
func main() {
memorySource := memory.NewSource(
memory.WithYAML(configData),
)
// Create new config
conf := config.NewConfig()
// Load file source
conf.Load(memorySource)
fmt.Println(string(conf.Bytes()))
}