oinker-go

command module
v0.0.0-...-22a00f0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

README

Oinker-Go

Example Go (golang) web app with dependency injection and graceful shutdown. Acts like a mini Twitter clone.

Dependencies

Building requires Go, Godep, Docker, & Make.

Code dependencies are vendored with Godep:

Compilation

Build a local binary:

make

Build a docker image:

make image

Operation

There are several ways to launch the Oinker server.

Source

Run from local source code:

go run main.go

(ctrl-c to quit)

Docker

Run in Docker:

docker run -d --name oinker -p 0.0.0.0:8080:8080 karlkfi/oinker-go:latest

With Cassandra:

docker run -d --name cassandra cassandra:2.2.3
docker run -d --name oinker --link cassandra:cassandra -p 0.0.0.0:8080:8080 karlkfi/oinker-go:latest --cassandra-addr=cassandra

Find Oinker IP:

docker inspect --format "{{.NetworkSettings.IPAddress}}" oinker
Marathon

Run in Marathon:

curl -H 'Content-Type: application/json' -X POST -d @"marathon.json" ${MARATHON_URL}/v2/apps
Kubernetes

Run in Kubernetes:

kubectl create -f kubernetes.yaml

Usage

Visit the home page at http://localhost:8080/

Enter handle & message & hit Oink.

See past oinks on the right-hand side of the home page.

Future

  • DNS SRV record Cassandra discovery
  • Analytics page

License

Copyright 2015 Karl Isenberg

Licensed under the Apache License Version 2.0 (the "License"); you may not use this project except in compliance with the License.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/github.com/dustin/go-humanize
Package humanize converts boring ugly numbers to human-friendly strings and back.
Package humanize converts boring ugly numbers to human-friendly strings and back.
_workspace/src/github.com/facebookgo/grace/gracehttp
Package gracehttp provides easy to use graceful restart functionality for HTTP server.
Package gracehttp provides easy to use graceful restart functionality for HTTP server.
_workspace/src/github.com/facebookgo/grace/gracenet
Package gracenet provides a family of Listen functions that either open a fresh connection or provide an inherited connection from when the process was started.
Package gracenet provides a family of Listen functions that either open a fresh connection or provide an inherited connection from when the process was started.
_workspace/src/github.com/facebookgo/httpdown
Package httpdown provides http.ConnState enabled graceful termination of http.Server.
Package httpdown provides http.ConnState enabled graceful termination of http.Server.
_workspace/src/github.com/facebookgo/stats
Package stats defines a lightweight interface for collecting statistics.
Package stats defines a lightweight interface for collecting statistics.
_workspace/src/github.com/gocql/gocql
Package gocql implements a fast and robust Cassandra driver for the Go programming language.
Package gocql implements a fast and robust Cassandra driver for the Go programming language.
_workspace/src/github.com/gocql/gocql/lru
Package lru implements an LRU cache.
Package lru implements an LRU cache.
_workspace/src/github.com/golang/snappy
Package snappy implements the snappy block-based compression format.
Package snappy implements the snappy block-based compression format.
_workspace/src/github.com/karlkfi/inject
Package inject provides a dependency injection library that uses constructor functions to define dependency relationships.
Package inject provides a dependency injection library that uses constructor functions to define dependency relationships.
_workspace/src/github.com/satori/go.uuid
Package uuid provides implementation of Universally Unique Identifier (UUID).
Package uuid provides implementation of Universally Unique Identifier (UUID).
_workspace/src/gopkg.in/inf.v0
Package inf (type inf.Dec) implements "infinite-precision" decimal arithmetic.
Package inf (type inf.Dec) implements "infinite-precision" decimal arithmetic.

Jump to

Keyboard shortcuts

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