npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-yogo

v0.1.3

Published

Generator golang allows to create projects like (Console ('Hello world'), REST-API, GO-KIT )

Downloads

4

Readme

YoGo - golang code generator

Logo

YoGo is a Yeoman generator for GO language, which allows you to create projects in the form of:

  • Console (basic "Hello world") apps
  • REST API microservice
  • GO-KIT API microservice

This tool is meant for developers with the aim of removing the need to recreate each time the same skeleton when starting a new project. YoGo generates it for him, so he can focus on implementing logic in new app.

The Go Programming Language

Detail info you can find here.

Preparation for Usage

  • Install nodejs and npm on your system

  • Install yeoman on your system

npm install -g yo
  • Install generator-yogo
npm install generator-yogo
  • Launch the generator
yo yogo

Create new project

Create a new directory in GOPATH/src

cd $GOPATH/src
mkdir [ProjectName]
cd [ProjectName]
yo yogo

...and follow the interactive option selection

Structure of projects

  NOTE: the YoGo generator will only generate the directory hierarchy in *$GOPATH/src*.

Example console app

Example REST API microservice

FYI: Future development will add support for:

  • KAFKA producer
  • KAFKA consumer
  • etc.

Generate project via docker

If you want to generate your project in a Docker container (i.e. you don't want to install the YoGo dependencies on your machine):

  • install docker on your machine
  • clone this repository (git clone)
  • open a terminal and go to the generator-yogo folder
  • enter the following command:

for windows users

docker build -t generator-yogo:latest .
docker run -it --rm -v {YOUR_LOCAL_PATH}:/home/yeoman -e LOCAL_PATH=${LOCAL_PATH} --name generator-yogo-container generator-yogo

for Linux and MacOS users

make docker-build
make docker-run LOCAL_PATH=<YOUR_LOCAL_PATH>

where <YOUR_LOCAL_PATH> is the local folder where you want your project to be generated.

ATTENTION: if you have error like :

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

follow this link: https://apple.stackexchange.com/questions/254380/macos-sierra-invalid-active-developer-path

How to create a new package in an existing microservice.

Open a terminal, and from your project's folder run:

yo yogo:pkgg

You can choose the kind of package you want to create and use:

  • config
  • REST-API endpoint
  • GO-KIT endpoint

Config package

One possible type of package is config. In this case, the package will be generated with the following structure

NOTE: By default, YOGO generates a config.toml file with three ENV variables ( APP_PORT, KAFKA_BROKERS, SVC_TRACING_ZIPKIN )

Extend config package

You can add a config.toml file in your project's root folder with the list of ENV variables you need.

For example:
TEST=12345
TEST1=4567
TEST2=qwerty
DB_PORT=5432

After doing this, when generating the config package, all variables will be added on top of the default ones (APP_PORT, KAFKA_BROKERS, SVC_TRACING_ZIPKIN).