Git Product home page Git Product logo

hex-go's Introduction

Go CLI - Template

Go Report Card

This is a template repository to create CLI using golang. It creates a powerful cli using Cobra and Viper as main packages.

Roadmap

  • Create a command list based in the product wanted
  • Search which events the service will emit. How: take an use case path and pinpoint the emitted events
  • Implement the use cases (commands) found in the past steps
  • Add the defined events to the project
  • Add better logging method

List of Commands

  • createUser: create an user in the system
  • createUserAndSendEmail: create an user in the system and send an email informing the sucessful creation
  • updateUserData: update the user using the informed data
  • getUserDataById: search an user with the userID
  • getUserByEmail: search an user with the email. This command will return a list of matched users

Setup

Create your own .config.yaml file to configure the CLI.

To set up the git hooks run the following command.

cp ./scripts/pre-commit-hook.sh .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit

Running Locally

go run ./cmd/golang-cli/main.go help

Dependency Management

This package uses go modules. Whenever you run go build or go test all dependencies will be downloaded automatically. See go.mod and go.sum to see all modules used by this package.

Configuration

Runtime

Many settings are set throught the .config.yaml file and read using the Viper package to set the configuration of the project and to retrieve the configuration values.

An example of the configuration file can be found at configs/.config.example.yaml.

Project Structure

The project structure used follows the project layout defined in Golang Standards - Project Layout, which used a lot of definitions found in the web and compiled an unified layout.

hex-go's People

Contributors

arielril avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.