Giter Site home page Giter Site logo

octomation / go-service Goto Github PK

View Code? Open in Web Editor NEW
7.0 3.0 0.0 1.05 MB

๐Ÿงฉ Template for a typical service written on Go.

Home Page: https://go-service.octolab.org/

License: MIT License

Shell 48.32% Makefile 22.95% Go 26.46% Dockerfile 2.27%
go golang service template octolab hacktoberfest quick-start

go-service's Introduction

Go Service

Coverage Quality Documentation CI/CD Promo Mirror Template

๐Ÿงฉ Service

Template for a typical service written on Go.

๐Ÿ›ซ Quick start

Work with Makefile
$ make setup
$ make help

$ make find-todos
$ make test lint
$ TIMEOUT=5s make test-with-coverage
Work with Taskfile
$ alias run=./Taskfile
$ run refresh
$ run help

$ run docs # === `run docs install -- build -- start`
$ run docs npm ci
$ run docs npm i nextra@latest

$ run tools go generate tools.go
$ run tools golangci-lint --version -- mockgen --version
$ run which goimports golangci-lint govulncheck mockgen
Work with Tools
$ make tools
$ source bin/activate

$ which goimports
$ goimports -local $(go list -m) -w ./...
Work with Docker
$ make go-1.19 # or go-1.20, etc.
/src# make go-env 2>/dev/null | grep GOVERSION
# GOVERSION:   1.19.10
/src# make test

๐Ÿ’ก Idea

Define a powerful template that quickly creates a new Go service. Not only does it provide a starting point for new projects, but it comes equipped with pre-configured ci/cd and inventory.

$ server up &
$ client call

๐Ÿ† Motivation

At OctoLab, we want to start new projects faster using best practices with a predefined structure and focusing on core ideas implementation rather than wasting time on environment configuration and copying boilerplate code.

๐Ÿคผโ€ How to

Build your own service

  1. Generate a new repository from the template.
  2. Clone the repository locally.
  3. Update the desired files as needed, e.g., run init my.new/service.
  4. Write your code and tests.
  5. ๐Ÿš€

Contribute to the template

  1. Read the contribution guidelines.
  2. Fork the repository.
  3. Make your changes.
  4. Send a pull request.
  5. ๐Ÿค—

Before you start, please make sure your changes are in demand. The best for that is to create a new discussion, or if you find an issue, report it first.

๐ŸŽ›๏ธ Configuration

Pre-configured

  1. GitHub Actions.
  2. GitHub Pages.
  3. Dependabot.

Included

  1. Nextra.
  2. Makefiles.
  3. Taskfiles.
  4. Go tools:

Optional

  1. Bitbucket1.
  2. Codecov.
  3. Slack.
  4. Settings2.
  5. Go Report Card.
  6. Shields.io.
  7. GitHub Socialify.

Coming soon

  1. Cloudflare Pages (docs hosting).
  2. CodeQL (code scanning).
  3. Graphite (git workflow).
  4. Qodana (code quality).
  5. SonarCloud (code quality).
  6. Vanity URL (canonical import path).
  7. Vercel (docs hosting).

๐Ÿ›ฌ Installation

Homebrew

$ brew install octolab/tap/service

Binary

$ curl -fsSL https://install.octolab.org/octomation/service | sh
# or
$ wget -qO-  https://install.octolab.org/octomation/service | sh

Source

# use standard go tools
$ go get go.octolab.org/template/service/cmd/client@latest
$ go get go.octolab.org/template/service/cmd/server@latest
# or use egg tool
$ egg tools add go.octolab.org/template/service/cmd/client@latest
$ egg tools add go.octolab.org/template/service/cmd/server@latest

Shell completions

$ client completion > /path/to/completions/...
# or
$ source <(client completion)

๐Ÿ—๏ธ Ecosystem

Input

Impact

Output

made with โค๏ธ for everyone by OctoLab

Footnotes

  1. An alternative for backup could be GitLab, Gogs, or Gitea. โ†ฉ

  2. It has been deprecated and will be replaced someday by GitHub Actions. โ†ฉ

go-service's People

Contributors

dependabot[bot] avatar kamilsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

go-service's Issues

boilerplate: define health endpoint

dev: add k8s

Motivation: up a local environment for development based on Kubernetes.

boilerplate: bootstrap: quick usage examples and best practices

Motivation: reduce the entry threshold.

Define and describe:

  • how to run a server
  • how to use test cases from service.http
  • how to up cluster (k8s or docker-compose)
  • how to generate code

To do:

  • write service.http
  • complete docker-compose part
  • complete codegeneration part

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.