idmapper

command module
v0.0.0-...-956ff96 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2019 License: MIT Imports: 6 Imported by: 0

README

idmapper

Build StatusGoDoc

simple web app using IDMappers

IDMapper

IDMapper is in-memory cache for mapping IDs to Names. Can be used to cache lists of IDs and Names (eg country list, languages list). More about IDMappers here

IDMappers reloading

IDMappers are reloaded automaticaly in background using scheduler

API

GET /health
GET /version
GET /metrics

GET /v1/country/{countrycode}
GET /v1/currency/{currencycode}
GET /v1/language/{languagecode}

Example:

curl localhost:8080/v1/country/sk
curl localhost:8080/v1/country/sk

Developement

Requirements
  • golang 1.12
  • make
  • git
Building
# build webapp
make build
# run tests
make test
# run tests and build webapp 
make all
# build docker image
make docker
Usage
./idmapperapp -h
Usage of ./idmapperapp:
  -a, --addr string     HTTP service address. (default "0.0.0.0:80")
  -c, --config string   path to config file
      --config-check    check configuration
  -p, --print-config    print configuration

Example:

./idmapperapp -c config-example.yaml -a localhost:8080
Documentation

https://godoc.org/github.com/danielkraic/idmapper

Configuration

There are two ways of providing configuration: using config file and using environmental variables. Both ways can be combined.

Using config file

See config-example.yaml for available options.

./idmappersapp --config config-example.yaml
Using environmental variables

Prefix for all environmental variables is IDMAPPER_.

Examples:

IDMAPPER_ADDR="localhost:8080" ./idmapperapp --print-config --config-check
IDMAPPER_LOGGER_JSON=true ./idmapperapp --print-config --config-check
IDMAPPER_REDIS_PASSWORD="secretpass" ./idmapperapp --print-config --config-check

Handling dependencies

Save all dependecies to vendor directory

go mod vendor

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
app

Jump to

Keyboard shortcuts

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