mammal

command module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 1 Imported by: 0

README

Mammal

A Sample Microservice.


Documentation

Linux Deployment

Download the latest mammal binary. Make it executable from everywhere.

$ export LATEST_VERSION=$(curl --silent "https://api.github.com/repos/clivern/mammal/releases/latest" | jq '.tag_name' | sed -E 's/.*"([^"]+)".*/\1/' | tr -d v)

$ curl -sL https://github.com/clivern/mammal/releases/download/v{$LATEST_VERSION}/mammal_{$LATEST_VERSION}_Linux_x86_64.tar.gz | tar xz

Create the configs file config.yml from config.dist.yml. Something like the following:

# App configs
app:
    # App name
    name: ${MAMMAL_APP_NAME:-mammal}
    # Env mode (dev or prod)
    mode: ${MAMMAL_APP_MODE:-prod}
    # HTTP port
    port: ${MAMMAL_API_PORT:-8000}
    # Hostname
    hostname: ${MAMMAL_API_HOSTNAME:-127.0.0.1}
    # TLS configs
    tls:
        status: ${MAMMAL_API_TLS_STATUS:-off}
        crt_path: ${MAMMAL_API_TLS_PEMPATH:-cert/server.crt}
        key_path: ${MAMMAL_API_TLS_KEYPATH:-cert/server.key}

    # Global timeout
    timeout: ${MAMMAL_API_TIMEOUT:-50}

    # Log configs
    log:
        # Log level, it can be debug, info, warn, error, panic, fatal
        level: ${MAMMAL_LOG_LEVEL:-info}
        # Output can be stdout or abs path to log file /var/logs/mammal.log
        output: ${MAMMAL_LOG_OUTPUT:-stdout}
        # Format can be json
        format: ${MAMMAL_LOG_FORMAT:-json}

The run the mammal with systemd

$ mammal server -c /path/to/config.yml
Docker Deployment

To build and push the image to docker hub registry.

$ docker build -t clivern/mammal:v1.3.0 .
$ docker push clivern/mammal:v1.3.0

To pull and run the microservice.

$ docker pull clivern/mammal:v1.3.0
$ docker run -d -p 8000:8000 clivern/mammal:v1.3.0

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Mammal is maintained under the Semantic Versioning guidelines and release process is predictable and business-friendly.

See the Releases section of our GitHub project for changelogs for each release version of Mammal. It contains summaries of the most noteworthy changes made in each release.

Bug tracker

If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/mammal/issues

Security Issues

If you discover a security vulnerability within Mammal, please send an email to hello@clivern.com

Contributing

We are an open source, community-driven project so please feel free to join us. see the contributing guidelines for more details.

License

© 2022, Clivern. Released under MIT License.

Mammal is authored and maintained by @clivern.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
core

Jump to

Keyboard shortcuts

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