Initial Bus implementation

This commit is contained in:
Ian Gulliver
2022-03-15 16:27:52 +00:00
parent eb60a6aacf
commit 88c24f1a40
5 changed files with 120 additions and 69 deletions

25
main.go
View File

@@ -5,20 +5,23 @@ import "fmt"
import "github.com/google/uuid"
func main() {
store := NewStore("foo")
store := NewStore("foo")
out := &Template{
Id: uuid.NewString(),
Test: "round trip",
}
out := &Template{
Id: uuid.NewString(),
Test: "round trip",
}
store.Write(out)
store.Write(out)
in := &Template{
Id: out.Id,
}
in := &Template{
Id: out.Id,
}
store.Read(in)
store.Read(in)
fmt.Printf("%+v\n", in)
fmt.Printf("%+v\n", in)
bus := NewBus()
bus.Announce(in)
}