Git Product home page Git Product logo

fuse's Introduction

Fuse
Fuse

Fuse is a golang project generator. It is not a framework, but rather a tool that helps you create and maintain your project structure. The main goal is to make dependency injection easy, provide minimum boilerplate code and to make it easy to add new components to your project.

Installation

Ensure that you have Go 1.18 or higher installed. To install this cli, run the following command:

go install github.com/hjblom/fuse@latest

Verify that the binary installed correctly by running the help command.

fuse --help

Output

A go project generator.

Usage:
  fuse [command]

Available Commands:
  add         Add components to the project
  completion  Generate the autocompletion script for the specified shell
  generate    Generate code for the project based on the configuration file
  help        Help about any command
  init        Initialize a new fuse project
  visualize   Visualize the project dependency graph

Flags:
  -c, --config string   Path to the config file (default ".fuse.yaml")
  -h, --help            help for fuse
  -t, --toggle          Help message for toggle

Use "fuse [command] --help" for more information about a command.

Quick start

Create a new project

Create a new project by running the init command.

fuse init my-service

This will initialize the project in the current directory and generate a default project structure.

cwd
├── cmd <todo>
│   └── main.go
|-- internal
│   |-- config.go
│   └── fuse.go
└── .fuse.yaml
  • config.go contains the configuration for the module. This will automatically be updated with packages that require configuration.
  • fuse.go wires all dependencies together and is the entrypoint for the project.

Add a package

fuse add package client -t config

This will create a new directory with the name client and generate a default package structure.

cwd
└── client
    |-- config.go
    |-- client.go
    └── interface.go
...
  • config.go contains the configuration for the package. This was automatically generated because the config tag was added. See TODO for more information on which tags are available.
  • client.go contains the implementation of the package.
  • interface.go contains the interface for the package.

To see additional options, add the --help flag to the add command.

fuse add package --help

Visualize

The visualize command generates a dependency graph of the project. It will generate a graph.svg file in the current directory.

fuse visualize

A sample graph generated by the example .fuse.yaml in the project:

Fuse

fuse's People

Contributors

hjblom avatar

Stargazers

 avatar Andrew Graham-Yooll avatar Bradley Chatha 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.