micro-starter

module
v0.0.0-...-045d1f4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 11, 2024 License: MIT

README

Micro github.com/micro

Slack

go-micro

Local

Build micro cmd

go build -o bin/micro cmd/micro/main.go

Start registry & api with server runtime

./bin/micro --profile starter-local server
Start registry & api with service command Run registry service ```shell script ./bin/micro --profile starter-local service registry ```

Run API service

./bin/micro --profile starter-local service api

Run example service

# Greeting
cd service/greeting
CGO_ENABLED=0 go run main.go --profile starter-local

Test example service

# Greeting
curl "http://localhost:8080/greeting/call?msg=helloworld"
{"id":"1","msg":"helloworld"}

curl "http://localhost:8080/greeting/list?page=1&size=10"
{"items":[{"id":"1","msg":"helloworld"}]}

Kubernetes

$ make snapshot

$ docker build ./ -f Dockerfile --platform=linux/amd64 -t registry.cn-hangzhou.aliyuncs.com/hb-chen/micro-starter-micro:latest

Attention: default ingress class=nginx, host=api.micro.hbchen.com

helm install -n micro micro-server manifests/charts/micro \
--set ingress.enabled=true

# Digest
helm install -n micro micro-server manifests/charts/micro \
--set image.tag="latest@sha256:aceabd67ac333dcd19bde3524c54e7a556b8651cf049495ab6e086d45bb7ad77" \
--set ingress.enabled=true
helm install -n micro micro-example manifests/charts/service

# Digest
helm install -n micro micro-example manifests/charts/service \
--set image.tag="latest@sha256:a2af30ff9a0a66ade77672e01679a2b02ead3b2b0f27bd7092d726d75fd069e0"
curl "http://api.micro.hbchen.com/greeting/call?msg=helloworld"

Directories

Path Synopsis
cmd
micro/server
Package server is the micro server which runs the whole system
Package server is the micro server which runs the whole system
micro/web
Package web is a web dashboard
Package web is a web dashboard
pkg
Package profile is for specific profiles @todo this package is the definition of cruft and should be rewritten in a more elegant way
Package profile is for specific profiles @todo this package is the definition of cruft and should be rewritten in a more elegant way
service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL