deckr

command module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

README

deckr 🃏

Go Doc Conventional Commits License

Deckr provides a REST API to simulate a deck of cards.

Contents

Requirements

  • Go 1.18+

  • Mage - replacement for Makefile in Go.

    go install github.com/magefile/mage@latest
    
  • Golangci-lint - Fast Go linters runner.

    go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
    
  • Ginkgo - Expressive testing framework.

    go install github.com/onsi/ginkgo/v2/ginkgo@latest
    
  • Swag - Generate REST API documentation.

    go install github.com/swaggo/swag/cmd/swag@latest
    
  • Docker - Containerization.

Mage Targets

$ mage -l
Targets:
  build:all           Builds for all supported popular OS/Arch
  build:linuxAmd64    Builds for Linux 64bit
  build:linuxArm64    Builds for Linux ARM 64bit
  build:macOSAmd64    Builds for MacOS 64bit
  build:macOSArm64    Builds for MacOS M1
  build:winAmd64      Builds for Windows 64bit
  docs                Generates docs
  lint                Run golangci linters
  test                Run tests
  testRace            Run tests with race detector
  tidy                Run go mod tidy
Example
Generate docs
$ mage -v docs
Run test with race detector
$ mage -v testRace
Build deckr for MacOS M1
$ mage -v build:macOSArm64

Install

  • You can install using the latest released binary.

  • OR using Go:

    $ go install github.com/mgjules/deckr@latest
    
  • OR bulding from source:

    Example (MacOS M1):

    $ mage -v build:macOSArm64
    

Usage

$ deckr --help
NAME:
   deckr - A REST API for playing with a deck of cards

USAGE:
   deckr [global options] command [command options] [arguments...]

DESCRIPTION:
   Deckr exposes a REST API for playing with a deck of cards of your choice.

AUTHOR:
   Michaël Giovanni Jules <julesmichaelgiovanni@gmail.com>

COMMANDS:
   serve       Starts the REST API server.
   version, v  Shows the version
   help, h     Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h  show help (default: false)

COPYRIGHT:
   (c) 2022 Michaël Giovanni Jules
REST API server
$ deckr serve --help
NAME:
   deckr serve - Starts the REST API server.

USAGE:
   deckr serve [command options] [arguments...]

OPTIONS:
   --debug       whether running in PROD or DEBUG mode (default: false) [$DECKR_DEBUG]
   --host value  host/IP for HTTP server (default: "localhost") [$DECKR_HOST]
   --port value  port for HTTP server (default: 9000) [$DECKR_PORT]
   --help, -h    show help (default: false)

API documentation

The API documentation is generated using Swag and is available at /swagger/index.html.

License

Deckr is Apache 2.0 licensed.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag
Package docs GENERATED BY SWAG; DO NOT EDIT This file was generated by swaggo/swag

Jump to

Keyboard shortcuts

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