Giter Club home page Giter Club logo

gowizard's Introduction

gowizard

Let a wizard guide you through your Go module set up quickly.

This project is still in development so use at your own risk!

Gopher Wizard

Installation

go install github.com/mahcks/gowizard@latest

Usage

Using the standard wizard:

gowizard

Quickly generate a new project with the needed services, controllers and adapters while bypassing the wizard:

gowizard generate --module github.com/username/module --path /path/to/module --adapter mariadb,redis,mongodb

Using a template:

gowizard generate --module github.com/username/module --template github.com/valid/template --path /path/to/module

Services

Each service has multiple "flavors" that can be used to generate the service. The following are the available flavors for each service.

REST

GraphQL

Controllers

REST

gRPC

Adapters

Structure

This structure is by no means the official structure for Go projects; however, it is a set of common historical and emerging project layout patterns in the Go ecosystem.

The following project was generated using the following command:

gowizard generate --module github.com/user/module --adapter mariadb,redis
generated-by-gowizard
 ┣ cmd
 ┃ ┗ cli
 ┃ ┃ ┗ main.go
 ┣ domain
 ┃ ┗ module.go
 ┣ templates
 ┃ ┣ adapters
 ┃ ┃ ┣ mariadb
 ┃ ┃ ┃ ┣ service.go
 ┃ ┃ ┃ ┗ template.go
 ┃ ┃ ┗ redis
 ┃ ┃ ┃ ┣ config.yaml
 ┃ ┃ ┃ ┣ service.go
 ┃ ┃ ┃ ┗ template.go
 ┃ ┗ logger
 ┣ README.md
 ┣ debug.log
 ┣ go.mod
 ┣ go.sum
 ┗ main.go

Templates

There are excellent repositories already set up with specific project layouts that may be more to your liking. Templates allow you to choose from a list of external repositories with pre-configured project layouts.

If the repository isn't listed, you may use gowizard template --custom to use a custom template. If you'd like the template to be added to the list, please open an issue.

What makes this different from just cloning the repository?

The wizard will ask you a few questions to help you get started with your project. It will also rename the module, use the optional path, and run a setup function if it's a pre-defined template that needs additional setup.

Development

Rename Makefile.local to Makefile, change the variables at the top, and run any of the commands to get started.

Contributing

Pull requests are welcome. For major or breaking changes, please open an issue first to discuss what you would like to change.

todo

  • generate makefile
  • generate readme with just the first line being # module add support for controllers
    • REST
    • gRPC

gowizard's People

Contributors

mahcks avatar

Watchers

 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.