Giter VIP home page Giter VIP logo

candi's Introduction

Candi, a framework and library for Membangun Candi project in Golang

Build Status Go Report Card codecov

Build with ❤️ and

golang logo docker logo rest logo graphql logo grpc logo kafka logo

Install CLI

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)

Create new service or add module in existing service

$ candi

The project is generated with this architecture diagram:

Build and run service

$ 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)

Server handlers example:

Worker handlers example:

Plugin: Candi Plugin

Example microservices project using this library: Backend Microservices

Features

  • Tracing

    • Using Jaeger for trace distributed system in microservices.
  • Graceful Shutdown for all servers and workers

Todo

Pronunciation

/can·di/ lihat! beliau membangun seribu candi dalam satu malam.

candi's People

Contributors

agungdwiprasetyo avatar dimassantoso avatar isogram avatar willy182 avatar

Stargazers

Denis Setianto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.