api

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

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

Go to latest
Published: Oct 26, 2018 License: GPL-2.0 Imports: 8 Imported by: 0

README

Lavaboom API

Code Climate

Lavaboom's main API written in Golang.

Contains the core Lavaboom's functionality. Currently a monolith, which later will be split and transformed into a set of microservices.

Requirements

  • Redis
  • RethinkDB
  • NSQ

Installation

Inside a Docker container

This image will be soon uploaded to Docker Hub.

git clone https://github.com/lavab/api.git
cd api
docker build -t "lavab/api" .
docker run \
	-p 127.0.0.1:5000:5000 \
	--name api \
	lavab/api \
	-redis_address=172.8.0.1:6379 \
	-lookupd_address=172.8.0.1:4161 \
	-nsqd_address=172.8.0.1:4150 \
	-rethinkdb_address=172.8.0.1:28015 \
	-api_host=api.lavaboom.com \
	-email_domain=lavaboom.com
Directly running the parts
go get github.com/lavab/api

api \
	-redis_address=172.8.0.1:6379 \
	-lookupd_address=172.8.0.1:4161 \
	-nsqd_address=172.8.0.1:4150 \
	-rethinkdb_address=172.8.0.1:28015 \
	-api_host=api.lavaboom.com \
	-email_domain=lavaboom.com

Passing configuration

You can use either commandline flags:

{ api } master » ./api -help
Usage of api:
  -api_version="v0": Shown API version
  -bind=":5000": Network address used to bind
  -config="": config file to load
  -email_domain="lavaboom.io": Domain of the default email service
  -etcd_address="": etcd peer addresses split by commas
  -etcd_ca_file="": etcd path to server cert's ca
  -etcd_cert_file="": etcd path to client cert file
  -etcd_key_file="": etcd path to client key file
  -etcd_path="settings/": Path of the keys
  -force_colors=false: Force colored prompt?
  -log="text": Log formatter type. Either "json" or "text"
  -lookupd_address="127.0.0.1:4160": Address of the lookupd server
  -nsqd_address="127.0.0.1:4150": Address of the nsqd server
  -redis_address="127.0.0.1:6379": Address of the redis server
  -redis_db=0: Index of redis database to use
  -redis_password="": Password of the redis server
  -rethinkdb_address="127.0.0.1:28015": Address of the RethinkDB database
  -rethinkdb_db="dev": Database name on the RethinkDB server
  -rethinkdb_key="": Authentication key of the RethinkDB database
  -session_duration=72: Session duration expressed in hours
  -slack_channel="#notif-api-logs": channel to which Slack bot will send messages
  -slack_icon=":ghost:": emoji icon of the Slack bot
  -slack_level="warning": minimal level required to have messages sent to slack
  -slack_url="": URL of the Slack Incoming webhook
  -slack_username="API": username of the Slack bot
  -yubicloud_id="": YubiCloud API id
  -yubicloud_key="": YubiCloud API key

Or environment variables:

{ api } master » BIND=127.0.0.1:6000 VERSION=v1 ./api

Or configuration files:

{ api } master » cat api.conf
# lines beggining with a "#" character are treated as comments
bind :5000
force_colors false
log text

rethinkdb_db dev
# configuration values can be empty
rethinkdb_key
# Keys and values can be also seperated by the "=" character
rethinkdb_url=localhost:28015

session_duration=72
version=v0
{ api } master » ./api -config api.conf

License

This project is licensed under the MIT license. Check license for more information.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Godeps
_workspace/src/code.google.com/p/go.crypto/pbkdf2
Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0.
Package pbkdf2 implements the key derivation function PBKDF2 as defined in RFC 2898 / PKCS #5 v2.0.
_workspace/src/code.google.com/p/go.crypto/scrypt
Package scrypt implements the scrypt key derivation function as defined in Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard Functions" (http://www.tarsnap.com/scrypt/scrypt.pdf).
Package scrypt implements the scrypt key derivation function as defined in Colin Percival's paper "Stronger Key Derivation via Sequential Memory-Hard Functions" (http://www.tarsnap.com/scrypt/scrypt.pdf).
_workspace/src/code.google.com/p/rsc/gf256
Package gf256 implements arithmetic over the Galois Field GF(256).
Package gf256 implements arithmetic over the Galois Field GF(256).
_workspace/src/code.google.com/p/rsc/qr
Package qr encodes QR codes.
Package qr encodes QR codes.
_workspace/src/code.google.com/p/rsc/qr/coding
Package coding implements low-level QR coding details.
Package coding implements low-level QR coding details.
_workspace/src/code.google.com/p/rsc/qr/libqrencode
Package libqrencode wraps the C libqrencode library.
Package libqrencode wraps the C libqrencode library.
_workspace/src/code.google.com/p/snappy-go/snappy
Package snappy implements the snappy block-based compression format.
Package snappy implements the snappy block-based compression format.
_workspace/src/github.com/ajstarks/svgo
Package svg generates SVG as defined by the Scalable Vector Graphics 1.1 Specification (<http://www.w3.org/TR/SVG11/>).
Package svg generates SVG as defined by the Scalable Vector Graphics 1.1 Specification (<http://www.w3.org/TR/SVG11/>).
barchart - bar chart
_workspace/src/github.com/ajstarks/svgo/benchviz
benchviz: visualize benchmark data from benchcmp
benchviz: visualize benchmark data from benchcmp
_workspace/src/github.com/ajstarks/svgo/pattern
pattern: test the pattern function
pattern: test the pattern function
_workspace/src/github.com/ajstarks/svgo/rr
radar roadmap (via Ernst and Young)
radar roadmap (via Ernst and Young)
_workspace/src/github.com/ajstarks/svgo/svgplay
svgplay: sketch with SVGo, (derived from the old misc/goplay), except: (1) only listen on localhost, (default port 1999) (2) always render html, (3) SVGo default code, (4) invoke the compiler and linker directly
svgplay: sketch with SVGo, (derived from the old misc/goplay), except: (1) only listen on localhost, (default port 1999) (2) always render html, (3) SVGo default code, (4) invoke the compiler and linker directly
_workspace/src/github.com/bitly/go-nsq
nsq is the official Go package for NSQ (http://nsq.io/) It provides high-level Consumer and Producer types as well as low-level functions to communicate over the NSQ protocol
nsq is the official Go package for NSQ (http://nsq.io/) It provides high-level Consumer and Producer types as well as low-level functions to communicate over the NSQ protocol
_workspace/src/github.com/cenkalti/backoff
Package backoff implements backoff algorithms for retrying operations.
Package backoff implements backoff algorithms for retrying operations.
_workspace/src/github.com/dancannon/gorethink
Package gorethink implements a Go driver for RethinkDB Current version: v1.0.0-rc.2 (RethinkDB v2.0) For more in depth information on how to use RethinkDB check out the API docs at http://rethinkdb.com/api
Package gorethink implements a Go driver for RethinkDB Current version: v1.0.0-rc.2 (RethinkDB v2.0) For more in depth information on how to use RethinkDB check out the API docs at http://rethinkdb.com/api
_workspace/src/github.com/dchest/uniuri
Package uniuri generates random strings good for use in URIs to identify unique objects.
Package uniuri generates random strings good for use in URIs to identify unique objects.
_workspace/src/github.com/garyburd/redigo/internal/redistest
Package redistest contains utilities for writing Redigo tests.
Package redistest contains utilities for writing Redigo tests.
_workspace/src/github.com/garyburd/redigo/redis
Package redis is a client for the Redis database.
Package redis is a client for the Redis database.
_workspace/src/github.com/getsentry/raven-go
Package raven implements a client for the Sentry error logging service.
Package raven implements a client for the Sentry error logging service.
_workspace/src/github.com/gokyle/hotp
Package hotp implements the RFC 4226 OATH-HOTP algorithm; these passwords derived from the HMAC-SHA1 of an internal counter.
Package hotp implements the RFC 4226 OATH-HOTP algorithm; these passwords derived from the HMAC-SHA1 of an internal counter.
_workspace/src/github.com/golang/protobuf/proto
Package proto converts data structures to and from the wire format of protocol buffers.
Package proto converts data structures to and from the wire format of protocol buffers.
_workspace/src/github.com/golang/protobuf/proto/proto3_proto
Package proto3_proto is a generated protocol buffer package.
Package proto3_proto is a generated protocol buffer package.
_workspace/src/github.com/gorilla/schema
Package gorilla/schema fills a struct with form values.
Package gorilla/schema fills a struct with form values.
_workspace/src/github.com/gorilla/websocket
Package websocket implements the WebSocket protocol defined in RFC 6455.
Package websocket implements the WebSocket protocol defined in RFC 6455.
_workspace/src/github.com/gorilla/websocket/examples/autobahn
Command server is a test server for the Autobahn WebSockets Test Suite.
Command server is a test server for the Autobahn WebSockets Test Suite.
_workspace/src/github.com/gyepisam/mcf
Package mcf is a Go library for creating, verifying, upgrading and managing bcrypt, scrypt, and pbkdf2 password hashes.
Package mcf is a Go library for creating, verifying, upgrading and managing bcrypt, scrypt, and pbkdf2 password hashes.
_workspace/src/github.com/gyepisam/mcf/bcrypt
Package bcrypt implements a password encoding mechanism for the mcf framework
Package bcrypt implements a password encoding mechanism for the mcf framework
_workspace/src/github.com/gyepisam/mcf/encoder
Package encoder represents an interface that MCF password encoders must implement
Package encoder represents an interface that MCF password encoders must implement
_workspace/src/github.com/gyepisam/mcf/password
Package password manipulates passwords stored in Modular Crypt Format.
Package password manipulates passwords stored in Modular Crypt Format.
_workspace/src/github.com/gyepisam/mcf/pbkdf2
Package pbkdf2 implements a password encoding mechanism for the mcf framework
Package pbkdf2 implements a password encoding mechanism for the mcf framework
_workspace/src/github.com/gyepisam/mcf/scrypt
Package scrypt implements a password encoding mechanism for the mcf framework
Package scrypt implements a password encoding mechanism for the mcf framework
_workspace/src/github.com/johntdyer/slackrus
Package slackrus provides a Hipchat hook for the logrus loggin package.
Package slackrus provides a Hipchat hook for the logrus loggin package.
_workspace/src/github.com/lavab/flag
Package flag implements command-line flag parsing.
Package flag implements command-line flag parsing.
_workspace/src/github.com/mreiferson/go-snappystream
snappystream wraps snappy-go and supplies a Reader and Writer for the snappy framed stream format: https://snappy.googlecode.com/svn/trunk/framing_format.txt
snappystream wraps snappy-go and supplies a Reader and Writer for the snappy framed stream format: https://snappy.googlecode.com/svn/trunk/framing_format.txt
_workspace/src/github.com/willf/bitset
Package bitset implements bitsets, a mapping between non-negative integers and boolean values.
Package bitset implements bitsets, a mapping between non-negative integers and boolean values.
_workspace/src/github.com/willf/bloom
Package bloom provides data structures and methods for creating Bloom filters.
Package bloom provides data structures and methods for creating Bloom filters.
_workspace/src/github.com/zenazn/goji/graceful
Package graceful implements graceful shutdown for HTTP servers by closing idle connections after receiving a signal.
Package graceful implements graceful shutdown for HTTP servers by closing idle connections after receiving a signal.
_workspace/src/github.com/zenazn/goji/graceful/listener
Package listener provides a way to incorporate graceful shutdown to any net.Listener.
Package listener provides a way to incorporate graceful shutdown to any net.Listener.
_workspace/src/github.com/zenazn/goji/web
Package web implements a fast and flexible middleware stack and mux.
Package web implements a fast and flexible middleware stack and mux.
_workspace/src/github.com/zenazn/goji/web/middleware
Package middleware provides several standard middleware implementations.
Package middleware provides several standard middleware implementations.
_workspace/src/github.com/zenazn/goji/web/mutil
Package mutil contains various functions that are helpful when writing http middleware.
Package mutil contains various functions that are helpful when writing http middleware.
_workspace/src/golang.org/x/crypto/cast5
Package cast5 implements CAST5, as defined in RFC 2144.
Package cast5 implements CAST5, as defined in RFC 2144.
_workspace/src/golang.org/x/crypto/openpgp
Package openpgp implements high level operations on OpenPGP messages.
Package openpgp implements high level operations on OpenPGP messages.
_workspace/src/golang.org/x/crypto/openpgp/armor
Package armor implements OpenPGP ASCII Armor, see RFC 4880.
Package armor implements OpenPGP ASCII Armor, see RFC 4880.
_workspace/src/golang.org/x/crypto/openpgp/clearsign
Package clearsign generates and processes OpenPGP, clear-signed data.
Package clearsign generates and processes OpenPGP, clear-signed data.
_workspace/src/golang.org/x/crypto/openpgp/elgamal
Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," IEEE Transactions on Information Theory, v.
Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," IEEE Transactions on Information Theory, v.
_workspace/src/golang.org/x/crypto/openpgp/errors
Package errors contains common error types for the OpenPGP packages.
Package errors contains common error types for the OpenPGP packages.
_workspace/src/golang.org/x/crypto/openpgp/packet
Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880.
Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880.
_workspace/src/golang.org/x/crypto/openpgp/s2k
Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1.
Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1.
_workspace/src/golang.org/x/crypto/ripemd160
Package ripemd160 implements the RIPEMD-160 hash algorithm.
Package ripemd160 implements the RIPEMD-160 hash algorithm.
_research

Jump to

Keyboard shortcuts

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