Skip to content

lab259/athena

Repository files navigation

athena CircleCI godoc license Coverage

Wisely building web applications.

Getting Started

Graceful Applications

With athena you can easily run net/http applications that will gracefully be stopped once receive a INTERRUPT signal (Ctrl+C). For example:

athena.GracefulHTTP(&http.Server{
    Addr:    ":3000",       // bind address
    Handler: app.Handler(), // your http handler
}, serviceStarter)          // from github.com/lab259/go-rscsrv

If you prefer fasthttp:

athena.GracefulFastHTTP(
    app.NewServer(),    // your fasthttp server
    ":3000",            // bind address
    serviceStarter,     // from github.com/lab259/go-rscsrv
)

Generate commands

athena ships with a CLI to generate models (for PostgreSQL and MongoDB) and services. Execute athena --help for more information:

Usage: athena [OPTIONS] COMMAND [arg...]

Wisely building web applications

Options:
  -v, --version   Show the version and exit

Commands:
  make:service    Generate a service
  make:model      Generate a model
  make:mgomodel   Generate a mgo model

Additional packages

athena/config

A configuration loader implementation from YAML files.

athena/pagination

Parse pagination values (current page and page size) with sane defaults.

athena/rscsrv

Built-in go-rscsrv's Service implementation for common services:

athena/testing

Utilities for testing applications:

  • envtest: overwrite environment variables
  • ginkgtest: initialize ginkgo with macchiato + reporters for CI
  • httptest: wrappers for net/http, fasthttp, hermes using httpexpect
  • mgotest: helpers for cleansing the database
  • psqltest: overwrite the default PostgreSQL service implemenation to use transations
  • rscsrvtest: initilize serveral services (with before and after hooks)

athena/validator

Validate structs and values using the go-playground/validator.v9.

Contributing

Prerequisites

What things you need to setup the project:

Environment

Close the repository:

git clone [email protected]:lab259/athena.git

Now, the dependencies must be installed.

cd athena && go mod download

😉 Finally, you are done to start developing.

Running tests

In the root directory, execute:

make test

To enable coverage, execute:

make coverage

To generate the HTML coverage report, execute:

make coverage coverage-html

About

Wisely building web applications

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •