granitic: github.com/graniticio/granitic/cmd/grnc-project Files | Directories

Command grnc-project

The grnc-project tool, used to generate skeleton project files for a new Granitic application. The generated project is module aware.

Running

grnc-project project-name [module-name]

Will create the following files and directories:

project-name
project-name/.gitignore
project-name/service.go
project-name/resource/components/components.json
project-name/resource/config/config.json
project-name/go.mod

This will allow a minimal Granitic application to be built and started by running:

cd project-name && grnc-bind && go build && ./project-name

Developers should pay attention to the import statements in the generated project-name.go file. It will contain a line similar to:

import "./bindings"

This is a relative import path, which will allow the project to be built and run with no knowledge of your workspace layout, but will prevent your application being installed with 'go install' and isn't considered good Go practice. The line should be changed to a non-relative path that reflects the layout of your Go workspace, which is most often:

import "github.com/yourGitHubUser/yourPackage/bindings"

Your project's module name will be the same as the project name unless you provide the module name as the second argument to this tool

The .gitignore file contains:

bindings*
project-name

Which prevents the output of 'grnc-bind' and 'go build' being included in your repository.

Package Files

main.go

Directories

PathSynopsis
generate

Package main imports 4 packages (graph). Updated 2019-05-08. Refresh now. Tools for package owners.