Releases: petomalina/xrpc
v2.3.0 Aluminium Kangaroo
This release adds some exported methods to the existing server
and exports the structure. No breaking changes are made since the server is just made public.
The server.Server
now exports server.IP()
, server.Host()
, and server.Port()
.
Two constants were also added to the server
package:
const (
// RandomPort is a constant used to let the system decide on the port
// for the server. This is commonly used for services that connect to
// each other via a registry (the server registers itself with host+port
// in a central list, so multiple can run on a single machine)
RandomPort = "0"
// DefaultTimeout represent a default value for the timeout option of the Server
DefaultTimeout = time.Second * 30
)
The server.New(server.RandomPort, server.DefaultTimeout)
will now return a new *Server
struct that exports all necessary information if you need the Host/Port information (e.g. to register the server in some registry).
srv, err := server.New(server.RandomPort, server.DefaultTimeout)
// handle err
// get the random port that was assigned to the server
port := srv.Port()
v2.2.1 Copper Cricket
Added an option to bind to a specific host:
srv, err := server.New(
os.Getenv("PORT"),
time.Second*30,
server.WithHost("localhost"),
)
v2.1.0 Tiny Cake
docs: bump installation command to v2
v2.0.0 Starlike Panther
This release updates grpc-gateway version to the newest v2
v1.3.1 Timewalking Silver Crocodile
This is a patch that fixes the timeout feature of the multiplexer.Server
srv, err := multiplexer.NewServer(port, time.Second*5)
The second parameter is now respected.
v1.3.0 Silver Crocodile
This release adds a new API for running the multiplexer with a graceful shutdown.
ctx, done := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
// ...
srv, err := multiplexer.NewServer(os.Getenv("PORT"), time.Second*5)
// ...
err = srv.ServeHTTPHandler(ctx,
multiplexer.Make(nil,
// filters all application/grpc messages into the grpc server
multiplexer.GRPCHandler(grpcServer),
// defaults all other messages into the http multiplexer
multiplexer.HTTPHandler(gwmux),
))
The example above creates a new context for SIGINT
and SIGTERM
and passes that to the srv.ServeHTTPHandler
method above the multiplexer.Server
type. Once this context is cancelled by the system, it automatically shuts down the h2c server of the handler.
v1.2.0 Gold Monkey
GRPC Handler
- the
GRPCHandler
now acceptshttp.Handler
instead of*grpcServer
as its first argument. This is not a breaking change, as the*grpc.Server
fulfills thehttp.Handler
interface. commit
func GRPCHandler(server http.Handler, selectors ...Selector) Handler { }
Multiplexer
- Added
HandlerFactory
type that is used by all handler creators. Creators can thus be passed separately and built from services in projects (docs needed) commit
v1.1.0 Mercury Alligator
This is the first major release of version 1, which includes:
- GRPC handler
- HTTP & Gateway Handler
- Pub/Sub Handler with authorization query parameters passes
- WebRPC Handler