module

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2022 License: MIT Imports: 4 Imported by: 0

README

Go Module

🧩 Module awesome.icon

Template for a typical module written on Go.

Build Coverage Quality Documentation

Promo Mirror Template

🛫 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 help

$ run docs
$ run docs install build start

Work with Tools

$ make tools
$ source bin/activate

$ which goimports
$ make go-fmt # goimports -local $(go list -m) -w ./...

Work with Docker

$ make go-1.11 # or go-1.12, etc.
/src# make go-env 2>/dev/null | grep GOVERSION
# GOVERSION:   1.11.13
/src# make test

💡 Idea

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

🏆 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 module
  1. Generate a new repository from the template.
  2. Clone the repository locally.
  3. Update files:
    • docs/CNAME, tools/pages/*, tools/*.jsx?,
    • go.mod, and README.md:
      • 🛫 Quick start
      • 💡 Idea
      • 🏆 Motivation
      • 🤼‍ How to
      • 🛬 Integration
  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. Bitbucket.
  2. Codecov.
  3. Slack.
  4. Settings.
  5. GitHub Socialify.
  6. Go Report Card.
  7. Shields.io.
Coming soon
  1. CodeQL (code scanning).
  2. Graphite (git workflow).
  3. Qodana (code quality).
  4. SonarCloud (code quality).
  5. Vanity URL (canonical import path).
  6. Vercel (docs preview).
Miscellaneous
  1. Crontab.guru.
  2. Git History.

🛬 Integration

The project uses SemVer for versioning, and it is not BC-safe through major releases. Please use Go Modules to manage its version.

$ go get go.octolab.org@latest

🤲 Outputs & outcomes

OctoLab
Octomation
Others

made with ❤️ for everyone

Documentation

Overview

Package module provides a template for a typical module written on Go.

It's a good starting point to build your module from scratch and not to think about boring stuff such as ci/cd configuring and docs publishing.

To learn more about the module, read the docs:

go doc -all .

Want to know how to write Go doc comments? Read the official guide.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PanicOnErr

func PanicOnErr(err error)

PanicOnErr panics if err is not nil.

func Ping

func Ping(ctx context.Context, m *Module) bool

Ping sends a request to the module and returns true if it's successful.

Types

type Module

type Module struct {
	// Limit is a module rate limit.
	Limit rate.Sometimes
	// contains filtered or unexported fields
}

A Module is a stub to show how to describe a type.

func NewModule

func NewModule() *Module

NewModule returns a new module with golang.org/x/time/rate.Sometimes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL