Categorygithub.com/joaosoft/builder
repositorypackage
0.0.0-20240320135123-84092131d553
Repository: https://github.com/joaosoft/builder.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

builder

Build Status | codecov | Go Report Card | GoDoc

A simple golang build and restart tool when some file of the project changes

If i miss something or you have something interesting, please be part of this project. Let me know! My contact is at the end.

With support for

  • Rebuild
  • Restart

Dependecy Management

Dep

Project dependencies are managed using Dep. Read more about Dep.

  • Install dependencies: dep ensure
  • Update dependencies: dep ensure -update

Go

go get github.com/joaosoft/builder

Usage

This examples are available in the project at builder/main/main.go

import (
	github.com/joaosoft/builder
	"os"
	"os/signal"
	"syscall"
)

func main() {
	termChan := make(chan os.Signal, 1)
	signal.Notify(termChan, syscall.SIGINT, syscall.SIGTERM, syscall.SIGUSR1)

	build := builder.NewBuilder(builder.WithReloadTime(1))

	if err := build.Start(nil); err != nil {
		panic(err)
	}

	<-termChan
	if err := build.Stop(nil); err != nil {
		panic(err)
	}
}

Configuration file

{
  "builder": {
    "source": "main/main.go",
    "destination": "bin/builder",
    "reload_time": 1,
    "log": {
      "level": "error"
    }
  },
  "watcher": {
    "reload_time": 1,
    "dirs": {
      "watch":[ "." ],
      "excluded":[ "vendor", "bin" ],
      "extensions": [ "go", "json", "yml" ]
    },
    "log": {
      "level": "error"
    }
  },
  "manager": {
    "log": {
      "level": "error"
    }
  }
}

Known issues

Follow me at

Facebook: https://www.facebook.com/joaosoft

LinkedIn: https://www.linkedin.com/in/jo%C3%A3o-ribeiro-b2775438/

If you have something to add, please let me know [email protected]