INNER CODE UNIT · Go

init

begmaroman/go-micro-boilerplate · services/rest-api-svc/cmd/main.go:19

func init() {
	// Set the default selector strategy to the custom RoundRobin.
	selector.DefaultSelector = selector.NewSelector(selector.SetStrategy(rpc.Random))
}

func main() {
	logger := logrus.New()

	// Initialize service.
	microService, err := microservice.Init(&microservice.ClientOptions{
		Version: Version,
		Log:     logger,
	})
	if err != nil {
		logger.WithError(err).Fatal("failed to initialize web-service")
	}

	// Run service.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…