go-boilerplate

command module
v0.0.0-...-238b541 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

README

Go(lang) Repository Pattern Boiler Plate

License

Before you explore the whole codes, please understand the what is the repository pattern and how it works. Some of these articles may help you to understand the concept:

Prerequisite

  • This boiler plate use GIN as the framework. (GIN)
  • This boiler plate use GORM as the ORM. (GORM)
  • This boiler plate use Goose as database migration tool. Please intall it before. (Goose)
  • This boiler plate use Dep as the dependency management tool. Please install it before. (Dep)
  • For live reloading utility on local connection, you can use Codegangsta - Gin.

Installation

  1. Clone this repository
  2. Run dep ensure
  3. If you use Codegangsta - Gin, run gin r main.go or if not, you can run go run main.go

License

See LICENSE.

Localization

Thanks to nicksnyder/go-i18n for the awesome package.

In this boiler plate, I just define two language (english and indonesian). You can override this according to what you need. The value of the language is store in .yaml file (in this case en.yaml and id.yaml).

How to used :

...
import "${GOROOT}/go-boilerplate/lang"
...

func Test() {
	...
	val := lang.Translate("your_key_on_yaml_file", nil)

	// If you need to parse attribute
	attribute := map[string]string{"Attribute": "Value"}
	val := lang.Translate("your_key_on_yaml_file", attribute)
	...
}
...

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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