For linux:
$ wget -O candi https://storage.googleapis.com/agungdp/bin/candi/candi-linux && chmod +x candi && sudo mv candi /usr/local/bin
$ candi
For macOS:
$ wget -O candi https://storage.googleapis.com/agungdp/bin/candi/candi-osx && chmod +x candi && mv candi /usr/local/bin
$ candi
For windows:
https://storage.googleapis.com/agungdp/bin/candi/candi-x64.exe (64 bit)
or
https://storage.googleapis.com/agungdp/bin/candi/candi-x86.exe (32 bit)
Or build binary from source:
$ go install github.com/golangid/candi/cmd/candi@latest
$ candi
Flag options:
$ candi --help
Usage of candi:
-add-handler
[project generator] add handler in delivery module in service
-add-module
[project generator] add module in service
-init
[project generator] init service
-init-monorepo
[project generator] init monorepo codebase
-libraryname string
[project generator] define library name (default "github.com/golangid/candi"), you can custom set to CANDI_CLI_PACKAGES global environment variable
-monorepo-name string
[project generator] set monorepo project name (default "monorepo")
-output string
[project generator] directory to write project to (default is service name)
-packageprefix string
[project generator] define package prefix
-protooutputpkg string
[project generator] define generated proto output target (if using grpc), with prefix is your go.mod
-run
[service runner] run selected service or all service in monorepo
-scope string
[project generator] set scope
1 for init service,
2 for add module(s),
3 for add delivery handler(s) in module,
4 for init monorepo codebase,
5 for run multiple service in monorepo
-service string
Describe service name (if run multiple services, separate by comma)
-version
print version
-withgomod
[project generator] generate go.mod or not (default true)
$ candi
$ cd {{service_name}}
$ make run
If include GRPC handler, run $ make proto
for generate rpc files from proto (must install protoc
compiler min version libprotoc 3.14.0
)
- Example Cron worker in delivery layer (Static Scheduler)
- Example Kafka consumer in delivery layer (Event Driven Handler)
- Example Redis subscriber in delivery layer (Dynamic Scheduler)
- Example Task queue worker in delivery layer
- Example Postgres event listener in delivery layer
- Example RabbitMQ consumer in delivery layer (Event Driven Handler and Dynamic Scheduler)
Plugin: Candi Plugin
Example microservices project using this library: Backend Microservices
-
Tracing
-
Graceful Shutdown for all servers and workers
-
Add task queue worker like celery and add UI for manage task queue worker=> https://github.com/agungdwiprasetyo/task-queue-worker-dashboard - Add Documentation
/can·di/
lihat! beliau membangun seribu candi dalam satu malam.
A big thank you to all contributors!