This repository contains a simple JSON-RPC 2.0 server implementation in Go using the jrpc2 library. The server provides several methods for string operations and alert handling.
- CountString: Counts the number of Unicode code points in a given string.
- Alert: Logs an alert message.
-
Clone the repository:
git clone https://github.com/karat-1/jrpc2server.git cd jrpc2server
-
Build the project:
go build
-
Start the server with the default address
localhost:8080
and a maximum of 1000 concurrent tasks:./jrpc2server
-
Customize the address and maximum concurrent tasks using command-line flags:
./jrpc2server -address="localhost:8080" -max=500
The server can be gracefully shut down by sending an interrupt signal (Ctrl+C). It will log the total number of received messages before exiting.
The server logs various events including startup, received alerts, and shutdown messages. All logs are printed to the standard output.
This project is licensed under the MIT License. See the LICENSE file for details.
- creachadair/jrpc2 for the JSON-RPC 2.0 library.