Home

Awesome

grpshuffle

A gRPC server and client that randomly assigns targets.

CI release go document go

Getting started

1. Install

Server

go install github.com/korosuke613/grpshuffle/go/grpshuffle_server@latest

Client

go install github.com/korosuke613/grpshuffle/go/grpshuffle_client@latest

2. Launch server

grpshuffle_server

3. Execute client

grpshuffle_client shuffle --no-tls -H localhost -P 13333 -p 2 a b c d e

result:

[
  {
    "targets": [
      "a",
      "c",
      "b"
    ]
  },
  {
    "targets": [
      "e",
      "d"
    ]
  }
]

Usage

client

shuffle

❯ grpshuffle_client shuffle --help
NAME:
   grpshuffle_client shuffle - shuffle

USAGE:
   grpshuffle_client shuffle [command options] DIVIDE TARGET1 TARGET2 ...

OPTIONS:
   --divide value, -d value  Number to divide (default: 0) [$GRPSHUFFLE_SHUFFLE_DIVIDE]
   --host value, -H value    Host address of server (default: "localhost") [$GRPSHUFFLE_HOST]
   --port value, -P value    Port of server (default: 13333) [$GRPSHUFFLE_PORT]
   --no-tls                  If this flag is enabled, TLS is not used. (default: false) [$GRPSHUFFLE_NO_TLS]
   --help, -h                show help (default: false)

http-serve

❯ grpshuffle_client http-serve --help
NAME:
   grpshuffle_client http-serve - HTTP client server

USAGE:
   grpshuffle_client http-serve [command options] [arguments...]

OPTIONS:
   --host value, -H value  Host address of server (default: "localhost") [$GRPSHUFFLE_HOST]
   --port value, -P value  Port of server (default: 13333) [$GRPSHUFFLE_PORT]
   --no-tls                If this flag is enabled, TLS is not used. (default: false) [$GRPSHUFFLE_NO_TLS]
   --help, -h              show help (default: false)

Build

make

Release

  1. Create git tag (git tag v0.0.x)
  2. Push git tag (git push origin v0.0.x)
  3. Auto publish by GitHub Actions (https://github.com/korosuke613/grpshuffle/actions/workflows/release.yaml)