go-gen
is a go service that allows users to provision a new service based on their specs
There are two parts to the service
- The api that handles a bulk of the service provisioning logic
- The cli that allows for interactions with the service
Since the service interacts with the Github API, you'll need a valid access token.
creating-a-personal-access-token
Make a new project directory where the service will be created for you
mkdir -p $GOPATH/src/{PROJECT_NAME}
cd $GOPATH/src/{PROJECT_NAME}
providing a spec file allows you to customize the service being created, otherwise, the default options will be used.
sample.yaml
name: "custom-yaml-repo"
owner: "Juan"
version: "1.0.0"
hasCopyright: true
hasLicense: true
description: "A custom go service from a yaml spec"
entrypoint: "custom-yaml-service"
hasGitignore: true
isPrivate: true
imports: ["fmt"]
mainBranch: "main"
sample.json
{
"name": "custom-json-repo",
"owner": "Juan",
"version": "1.0.0",
"hasCopyright": true,
"hasLicense": true,
"description": "A custom go service from a json spec",
"entrypoint": "custom-json-service",
"hasGitignore": true,
"isPrivate": true,
"imports": ["fmt"],
"mainBranch": "main"
}
For a default service
go-gen generate --token={GH_TOKEN}
For a configured service
go-gen generate --token={GH_TOKEN} --file={spec.yaml OR spec.json}
github.com/google/go-github
- github apigolang.org/x/oauth2
- github authgithub.com/urfave/cli/v2
- cligopkg.in/yaml.v2
- yaml -> structgithub.com/sirupsen/logrus
- server logging
go-gen
is licensed under the MIT License. Please see the LICENSE file for details.
- More Test Coverage
- Create PR from the templated service (not available in GH api)
- Support permissions throughout the process
- Support GH Repo configuration
- Support editing/deleting in case of a mistake
- Open Repoistory link after creation
- VSCode Extension
- Add Contributors
- Add interactions to the CLI (ex: do you want to clone the repo ? (y/n))