# README
Moleculer Go
š Progressive microservices framework for Go
Inspired and compatible with Moleculer JS
Simple, fast, light and fun to develop with. Also easy, very easy to test ;)
Get Started
Example
package main
import (
"fmt"
"github.com/nnqq/moleculer"
"github.com/nnqq/moleculer/broker"
)
type MathService struct {
}
func (s MathService) Name() string {
return "math"
}
func (s *MathService) Add(params moleculer.Payload) int {
return params.Get("a").Int() + params.Get("b").Int()
}
func (s *MathService) Sub(a int, b int) int {
return a - b
}
func main() {
var bkr = broker.New(&moleculer.Config{LogLevel: "error"})
bkr.Publish(&MathService{})
bkr.Start()
result := <-bkr.Call("math.add", map[string]int{
"a": 10,
"b": 130,
})
fmt.Println("result: ", result.Int())
//$ result: 140
bkr.Stop()
}
Roadmap
v0.1.0 (MVP)
Development is complete
- Documentation is in-progress
and benchmark is also in-progress
.
Contents:
- Service Broker
- Transit and Transport
- Actions (request-reply)
- Events
- Mixins
- Load balancing for actions and events (random round-robin)
- Service registry & dynamic service discovery
- Versioned services
- Middlewares
- NATS Streaming Transporter
- JSON Serializer
- Examples :)
v0.2.0 (Beta RC1)
- Action validators
- Support for streams
- More Load balancing implementations (cpu-usage, latency)
- Fault tolerance features (Circuit Breaker, Bulkhead, Retry, Timeout, Fallback)
- Built-in caching solution (memory, Redis)
- More transporters (gRPC, TCP, Redis, Kafka)
- More serializers (Avro, MsgPack, Protocol Buffer, Thrift)
v0.3.0 (Beta)
- Performance and Optimization
- More DB Adaptors (SQLLite, Firebase, MySQL)
- CLI for Project Seed Generation
v0.4.0 (Alpha)
- Event Sourcing Mixins
v0.5.0 (Release)
Installation
$ go get github.com/nnqq/moleculer
Running examples
# simple moleculer db example with memory adaptor
$ go run github.com/moleculer-go/store/examples/users
# simple moleculer db example with Mongo adaptor
$ go run github.com/moleculer-go/store/examples/usersMongo
# simple moleculer db example with SQLite adaptor
$ go run github.com/moleculer-go/store/examples/usersSQLite
# complex moleculer db example with population of fields by other services
$ go run github.com/moleculer-go/store/examples/populates
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author
# Structs
No description provided by the author
Needs Refactoring..2 broker interfaces.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Interfaces
ActionSchema is used by the validation engine to check if parameters sent to the action are valid.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Payload contains the data sent/return to actions.
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author