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

  • By Michaël Giovanni Jules
  • Last update: Dec 15, 2022
  • Comments: 6

deckr 🃏

Go Doc Conventional Commits License

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

Contents

Requirements

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
  proto               Generate stubs from proto files
  test                Run tests
  testRace            Run tests with race detector
  tidy                Run go mod tidy

Example

Generate docs

$ mage -v docs

Generate stubs from proto files

$ mage -v proto

Run tests with race detector

$ mage -v testRace

Build deckr for MacOS M1

$ mage -v build:macOSArm64

Install

Usage

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

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

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

AUTHOR:
   Michaël Giovanni Jules <[email protected]>

COMMANDS:
   serve       Starts the REST/gRPC 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/gRPC API server

$ deckr serve --help
NAME:
   deckr serve - Starts the REST/gRPC API server.

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

OPTIONS:
   --debug              whether running in PROD or DEBUG mode (default: false) [$DECKR_DEBUG]
   --server-uri value   URI of server (default: "http://localhost:9000") [$DECKR_SERVER_URI]
   --storage-uri value  URI of storage (default: "inmemory://") [$DECKR_STORAGE_URI]
   --help, -h           show help (default: false)

REST/gRPC API documentation

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

License

Deckr is Apache 2.0 licensed.

Download

deckr.zip

Comments(6)

  • 1

    chore(deps): bump go.uber.org/zap from 1.21.0 to 1.23.0

    Bumps go.uber.org/zap from 1.21.0 to 1.23.0.

    Release notes

    Sourced from go.uber.org/zap's releases.

    v1.23.0

    Enhancements:

    • #1147[]: Add a zapcore.LevelOf function to determine the level of a LevelEnabler or Core.
    • #1155[]: Add zap.Stringers field constructor to log arrays of objects that implement String() string.

    #1147: uber-go/zap#1147 #1155: uber-go/zap#1155

    v1.22.0

    Enhancements:

    • #1071[]: Add zap.Objects and zap.ObjectValues field constructors to log arrays of objects. With these two constructors, you don't need to implement zapcore.ArrayMarshaler for use with zap.Array if those objects implement zapcore.ObjectMarshaler.
    • #1079[]: Add SugaredLogger.WithOptions to build a copy of an existing SugaredLogger with the provided options applied.
    • #1080[]: Add *ln variants to SugaredLogger for each log level. These functions provide a string joining behavior similar to fmt.Println.
    • #1088[]: Add zap.WithFatalHook option to control the behavior of the logger for Fatal-level log entries. This defaults to exiting the program.
    • #1108[]: Add a zap.Must function that you can use with NewProduction or NewDevelopment to panic if the system was unable to build the logger.
    • #1118[]: Add a Logger.Log method that allows specifying the log level for a statement dynamically.

    Thanks to @​cardil, @​craigpastro, @​sashamelentyev, @​shota3506, and @​zhupeijun for their contributions to this release.

    #1071: uber-go/zap#1071 #1079: uber-go/zap#1079 #1080: uber-go/zap#1080 #1088: uber-go/zap#1088 #1108: uber-go/zap#1108 #1118: uber-go/zap#1118

    Changelog

    Sourced from go.uber.org/zap's changelog.

    1.23.0 (24 Aug 2022)

    Enhancements:

    • #1147[]: Add a zapcore.LevelOf function to determine the level of a LevelEnabler or Core.
    • #1155[]: Add zap.Stringers field constructor to log arrays of objects that implement String() string.

    #1147: uber-go/zap#1147 #1155: uber-go/zap#1155

    1.22.0 (8 Aug 2022)

    Enhancements:

    • #1071[]: Add zap.Objects and zap.ObjectValues field constructors to log arrays of objects. With these two constructors, you don't need to implement zapcore.ArrayMarshaler for use with zap.Array if those objects implement zapcore.ObjectMarshaler.
    • #1079[]: Add SugaredLogger.WithOptions to build a copy of an existing SugaredLogger with the provided options applied.
    • #1080[]: Add *ln variants to SugaredLogger for each log level. These functions provide a string joining behavior similar to fmt.Println.
    • #1088[]: Add zap.WithFatalHook option to control the behavior of the logger for Fatal-level log entries. This defaults to exiting the program.
    • #1108[]: Add a zap.Must function that you can use with NewProduction or NewDevelopment to panic if the system was unable to build the logger.
    • #1118[]: Add a Logger.Log method that allows specifying the log level for a statement dynamically.

    Thanks to @​cardil, @​craigpastro, @​sashamelentyev, @​shota3506, and @​zhupeijun for their contributions to this release.

    #1071: uber-go/zap#1071 #1079: uber-go/zap#1079 #1080: uber-go/zap#1080 #1088: uber-go/zap#1088 #1108: uber-go/zap#1108 #1118: uber-go/zap#1118

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • 2

    chore(deps): bump go.uber.org/zap from 1.21.0 to 1.24.0

    Bumps go.uber.org/zap from 1.21.0 to 1.24.0.

    Release notes

    Sourced from go.uber.org/zap's releases.

    v1.24.0

    Enhancements:

    • #1148[]: Add Level to both Logger and SugaredLogger that reports the current minimum enabled log level.
    • #1185[]: SugaredLogger turns errors to zap.Error automatically.

    Thanks to @​Abirdcfly, @​craigpastro, @​nnnkkk7, and @​sashamelentyev for their contributions to this release.

    #1148: uber-go/zap#1148 #1185: uber-go/zap#1185

    v1.23.0

    Enhancements:

    • #1147[]: Add a zapcore.LevelOf function to determine the level of a LevelEnabler or Core.
    • #1155[]: Add zap.Stringers field constructor to log arrays of objects that implement String() string.

    #1147: uber-go/zap#1147 #1155: uber-go/zap#1155

    v1.22.0

    Enhancements:

    • #1071[]: Add zap.Objects and zap.ObjectValues field constructors to log arrays of objects. With these two constructors, you don't need to implement zapcore.ArrayMarshaler for use with zap.Array if those objects implement zapcore.ObjectMarshaler.
    • #1079[]: Add SugaredLogger.WithOptions to build a copy of an existing SugaredLogger with the provided options applied.
    • #1080[]: Add *ln variants to SugaredLogger for each log level. These functions provide a string joining behavior similar to fmt.Println.
    • #1088[]: Add zap.WithFatalHook option to control the behavior of the logger for Fatal-level log entries. This defaults to exiting the program.
    • #1108[]: Add a zap.Must function that you can use with NewProduction or NewDevelopment to panic if the system was unable to build the logger.
    • #1118[]: Add a Logger.Log method that allows specifying the log level for a statement dynamically.

    Thanks to @​cardil, @​craigpastro, @​sashamelentyev, @​shota3506, and @​zhupeijun for their contributions to this release.

    #1071: uber-go/zap#1071 #1079: uber-go/zap#1079 #1080: uber-go/zap#1080 #1088: uber-go/zap#1088

    ... (truncated)

    Changelog

    Sourced from go.uber.org/zap's changelog.

    1.24.0 (30 Nov 2022)

    Enhancements:

    • #1148[]: Add Level to both Logger and SugaredLogger that reports the current minimum enabled log level.
    • #1185[]: SugaredLogger turns errors to zap.Error automatically.

    Thanks to @​Abirdcfly, @​craigpastro, @​nnnkkk7, and @​sashamelentyev for their contributions to this release.

    #1148: https://github.coml/uber-go/zap/pull/1148 #1185: https://github.coml/uber-go/zap/pull/1185

    1.23.0 (24 Aug 2022)

    Enhancements:

    • #1147[]: Add a zapcore.LevelOf function to determine the level of a LevelEnabler or Core.
    • #1155[]: Add zap.Stringers field constructor to log arrays of objects that implement String() string.

    #1147: uber-go/zap#1147 #1155: uber-go/zap#1155

    1.22.0 (8 Aug 2022)

    Enhancements:

    • #1071[]: Add zap.Objects and zap.ObjectValues field constructors to log arrays of objects. With these two constructors, you don't need to implement zapcore.ArrayMarshaler for use with zap.Array if those objects implement zapcore.ObjectMarshaler.
    • #1079[]: Add SugaredLogger.WithOptions to build a copy of an existing SugaredLogger with the provided options applied.
    • #1080[]: Add *ln variants to SugaredLogger for each log level. These functions provide a string joining behavior similar to fmt.Println.
    • #1088[]: Add zap.WithFatalHook option to control the behavior of the logger for Fatal-level log entries. This defaults to exiting the program.
    • #1108[]: Add a zap.Must function that you can use with NewProduction or NewDevelopment to panic if the system was unable to build the logger.
    • #1118[]: Add a Logger.Log method that allows specifying the log level for a statement dynamically.

    Thanks to @​cardil, @​craigpastro, @​sashamelentyev, @​shota3506, and @​zhupeijun for their contributions to this release.

    #1071: uber-go/zap#1071 #1079: uber-go/zap#1079 #1080: uber-go/zap#1080 #1088: uber-go/zap#1088

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • 3

    chore(deps): bump github.com/imdario/mergo from 0.3.12 to 0.3.13

    Bumps github.com/imdario/mergo from 0.3.12 to 0.3.13.

    Release notes

    Sourced from github.com/imdario/mergo's releases.

    Merging same-type slices supported, YAML upgraded to v3 (only used in tests), and more flexibility for transformers

    What's Changed

    New Contributors

    Full Changelog: https://github.com/imdario/mergo/compare/0.3.12...v0.3.13

    Commits
    • 1949787 Update README.md
    • 80c13e1 Merge pull request #212 from imdario/dcc/issue-206
    • f86e6f6 Upgrade yaml to v3
    • 39ebbbb Merge pull request #210 from heaths/issue209
    • fd7d2bc Merge pull request #211 from zaquestion/transformer_valid_destination
    • 8109749 add test for deepMerge panic
    • 4bed36e add test for keeping zero values with transformer
    • ab6b270 fix: gate transformers on valid non-nil destinations
    • 200f90d Support slices of same type
    • fd3dfc9 Merge pull request #191 from marcauberer/master
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • 4

    chore(deps): bump google.golang.org/grpc from 1.46.2 to 1.51.0

    Bumps google.golang.org/grpc from 1.46.2 to 1.51.0.

    Release notes

    Sourced from google.golang.org/grpc's releases.

    Release 1.51.0

    Behavior Changes

    • xds: NACK EDS resources with duplicate addresses in accordance with a recent spec change (#5715)
    • grpc: restrict status codes that can be generated by the control plane (gRFC A54) (#5653)

    New Features

    • client: set grpc-accept-encoding header with all registered compressors (#5541)
    • xds/weightedtarget: return a more meaningful error when all child policies are in TRANSIENT_FAILURE (#5711)
    • gcp/observability: add "started rpcs" metric (#5768)
    • xds: de-experimentalize the google-c2p-resolver (#5707)
    • balancer: add experimental Producer types and methods (#5669)
    • orca: provide a way for LB policies to receive OOB load reports (#5669)

    Bug Fixes

    • go.mod: upgrade x/text dependency to address CVE 2022-32149 (#5769)
    • client: fix race that could lead to an incorrect connection state if it was closed immediately after the server's HTTP/2 preface was received (#5714)
    • xds: ensure sum of the weights of all EDS localities at the same priority level does not exceed uint32 max (#5703)
    • client: fix binary logging bug which logs a server header on a trailers-only response (#5763)
    • balancer/priority: fix a bug where unreleased references to removed child policies (and associated state) was causing a memory leak (#5682)
    • xds/google-c2p: validate URI schema for no authorities (#5756)

    Release 1.50.1

    New Features

    • gcp/observability: support new configuration defined in public preview user guide

    Release 1.50.0

    Behavior Changes

    • client: use proper "@" semantics for connecting to abstract unix sockets. (#5678)
      • This is technically a bug fix; the result is that the address was including a trailing NULL byte, which it should not have. This may break users creating the socket in Go by prefixing a NULL instead of an "@", though, so calling it out as a behavior change.

    New Features

    • metadata: add experimental ValueFromIncomingContext to more efficiently retrieve a single value (#5596)
    • stats: provide peer information in HandleConn context (#5589)
    • xds: add support for Outlier Detection, enabled by default (#5435, #5673)

    Bug Fixes

    • client: fix deadlock in transport caused by GOAWAY racing with stream creation (#5652)

    ... (truncated)

    Commits
    • eeb9afa Change version to 1.51.0 (#5782)
    • 72812fe gcp/observability: filter logging from cloud ops endpoints calls (#5765)
    • 0ae33e6 xdsclient: remove unused test code (#5772)
    • 824f449 go.mod: upgrade x/text to v0.4 to address CVE (#5769)
    • 7f23df0 xdsclient: switch xdsclient watch deadlock test to e2e style (#5697)
    • 32f969e o11y: Added started rpc metric in o11y plugin (#5768)
    • b597a8e xdsclient: improve authority watchers test (#5700)
    • e41e894 orca: create ORCA producer for LB policies to use to receive OOB load reports...
    • 36d14db Fix binary logging bug which logs a server header on a trailers only response...
    • fcb8bdf xds/google-c2p: validate url for no authorities (#5756)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • 5

    chore(deps): bump github.com/jackc/pgx/v4 from 4.16.1 to 4.17.2

    Bumps github.com/jackc/pgx/v4 from 4.16.1 to 4.17.2.

    Changelog

    Sourced from github.com/jackc/pgx/v4's changelog.

    4.17.2 (September 3, 2022)

    • Fix panic when logging batch error (Tom Möller)

    4.17.1 (August 27, 2022)

    • Upgrade puddle to v1.3.0 - fixes context failing to cancel Acquire when acquire is creating resource which was introduced in v4.17.0 (James Hartig)
    • Fix atomic alignment on 32-bit platforms

    4.17.0 (August 6, 2022)

    • Upgrade pgconn to v1.13.0
    • Upgrade pgproto3 to v2.3.1
    • Upgrade pgtype to v1.12.0
    • Allow background pool connections to continue even if cause is canceled (James Hartig)
    • Add LoggerFunc (Gabor Szabad)
    • pgxpool: health check should avoid going below minConns (James Hartig)
    • Add pgxpool.Conn.Hijack()
    • Logging improvements (Stepan Rabotkin)
    Commits
    • d42b399 Update changelog
    • dfce986 Fix panic when logging batch error
    • f5cdf0d Update changelog
    • 72fe594 Upgrade to puddle v1.3.0
    • bce26b8 Fix atomic alignment on 32-bit platforms
    • 1d748d9 Failsafe timeout for background pool connections
    • 6871a0c Add v5 testing note to readme
    • 5768a0c Update changelog
    • 7ce634d Ensure there is a timeout for background pool connections
    • f3e04b2 Go 1.19 go fmt
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • 6

    chore(deps): bump google.golang.org/protobuf from 1.28.0 to 1.28.1

    Bumps google.golang.org/protobuf from 1.28.0 to 1.28.1.

    Release notes

    Sourced from google.golang.org/protobuf's releases.

    v1.28.1

    This release contains protoc-gen-go binaries for arm64.

    Notable changes since v1.28.0:

    • CL/418677: internal/impl: improve MessageInfo.New performance
    • CL/411377: proto: short-circuit Equal when inputs are identical
    • CL/419714: all: Add prebuild binaries for arm64
    Commits
    • 6875c3d all: release v1.28.1
    • 881da6e all: Add prebuild binaries for arm64
    • 2a74a0e A+C: delete AUTHORS and CONTRIBUTORS
    • de9682a internal/impl: improve MessageInfo.New performance
    • b0a9446 all: reformat with go1.19 gofmt
    • c1bbc5d all: make integration test work on darwin/arm64
    • 5f429f7 proto: fix compilation failure in tests
    • fc44d00 proto: use reflect.Ptr for backward compatibility
    • 380c339 proto: short-circuit Equal when inputs are identical
    • 784c482 all: remove shorthand import aliases
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)