example-go-messenger

command module
v0.0.0-...-2b0f304 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2016 License: Apache-2.0 Imports: 13 Imported by: 0

README

Messenger example in GO Build Status

Apache 2.0 License codecov Go Report Card

example-messenger-go is a proof of concept implementation of messenger app in GO.

Running tests

$ go test -v ./

test coverage:

go test -covermode=count -coverprofile=count.out ./ && go tool cover -html=count.out

Building

govend is used for vendoring.

govend -v 

go build

Configuration

12-factor principles are followed for app configuration. All config values are stored in environmental variables prefixed with "APP_". envconfig package is used for configuration processing.

Configuration options

// HTTPHost is address on which HTTP server endpoint is listening.
HTTPHost string `envconfig:"default=0.0.0.0"`

// HTTPPort is a port number on which HTTP server endpoint is listening.
HTTPPort int `envconfig:"default=8080"`

// LogLevel is a minimal log severity required for the message to be logged.
// Valid levels: [debug, info, warn, error, fatal, panic].
LogLevel string `envconfig:"default=info"`

Endpoints

Swagger 2.0 is used for REST endpoint documentation. It's available at /v1/swagger.json.

swagger-go project is used for documentation through annotations.

To regenerate:


swagger generate spec -o ./swagger.json

Using docker

build locally

$ docker build -t szpakas/example-go-messenger .

or pull from docker hub

$ docker pull szpakas/example-go-messenger
docker run --rm -i \
    -p 8080:8080 \
    -e "APP_LOG_LEVEL=debug" \
    --name example-go-messenger szpakas/example-go-messenger

License

Apache 2.0, see LICENSE.

Documentation

Overview

Package classification Messenger API.

the purpose of this application is to provide an test bed platform for toying with GO

Terms Of Service:

there are no TOS at this moment, use at your own risk we take no responsibility

Schemes: http
Host: localhost:8080
BasePath: /
Version: 0.0.1
License: Apache 2.0
Contact: Adam Szpakowski <szpakas@gmail.com>

Consumes:
- application/json

Produces:
- application/json

swagger:meta

Jump to

Keyboard shortcuts

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