gox

command module
v0.0.0-...-e71097d Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2017 License: Apache-2.0 Imports: 2 Imported by: 0

README

GoDoc Go Report Card

GoX (0.3 alpha)

GoX is a go tool, to build and run your go server application in a docker container.

Install

go get github.com/maprost/gox

Actions

gox init / gox
  • init all dependencies in docker container for your test environment
    • it's mainly to run your tests in IntelliJ or at the terminal
  • default behavior of gox.
gox build
  1. run godep [save|update] ./..., if activated (-godep)
  2. check style in a docker container, build failed if -style is activated and there are some check style warnings
    1. go vet
    2. golint
    3. gocyclo, check cyclomatic complexities of functions in Go source code (shouldn't be higher than 10)
  3. compile your project in a docker container
  4. test your project in a docker container (therefor init all dependencies)
  5. build docker image
  6. build a shell script for the server, if activated (-shell)
  7. build a docker compose script for the server, if activated (-compose)
  • additional commands:
    • -config: set the config, the project need in the docker image
    • -testconfig: set the config for the build container and testing
gox binrun
  • this mode exists mostly for local testing
  1. build a binary of your project
  2. init all dependencies, if not deactivated (-fast)
  3. run the binary
  • additional commands:
    • -config: set the config, the project need in the docker image
gox tools
  • see all states of your docker container/images
  • pull all needed docker images (-pull)
  • clean your docker images (-clean)
  • build a travis ci script (-travis)

Supported Databases

  • Postgres
Planned Databases
  • MySql
  • Google Cloud Datastore
  • MongoDB

Dependencies

  • docker (has to be installed on the system)
  • godep (has to be installed go get github.com/tools/godep)
  • golint (will be downloaded into a docker container and execute)
  • gocyclo (will be downloaded into a docker container and execute)

Config

type config struct {
	Port   string   // mandatory, port of server (optional for test config)
	Docker struct { // optional, if not set -> don't use a docker container (be careful -> paths depend on build system)
		Container string   // optional, default: name of project
		Image     string   // optional, default: golang:latest
		Volume    []string // optional, public resource folder like: html, css, images...
	}
	Databases []struct { // optional,
		Driver   string   // mandatory, driver of your database ['postgres']
		Dbname   string   // mandatory, name of the used database
		User     string   // mandatory
		Password string   // optional, default: ''
		Host     string   // optional, default: localhost
		Port     string   // optional, default: std port of db
		Docker   struct { // optional, if not set -> database is not in a docker container
			Container string // optional, default: Driver+Port
			Image     string // optional, default: Driver:latest
			Discspace string // optional, for mode hdd mandatory
		}
	}
	Property map[string]string // optional, some input like client urls or keys
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db
log

Jump to

Keyboard shortcuts

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