Discover Packages
github.com/odpf/salt
mux
package
Version:
v0.2.4
Opens a new window with list of versions in this module.
Published: Sep 26, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Mux
mux
package provides protocol multiplexing for HTTP & gRPC servers.
Usage
Refer _example/ for usage reference.
Expand ▾
Collapse ▴
Documentation
¶
Serve starts a TCP listener and serves the registered protocol servers and blocks
until server exits. Context can be cancelled to perform graceful shutdown.
Use WithHTTP() and WithGRPC() to register protocol servers.
type Option func(m *muxServer) error
Option values can be used with Serve() for customisation.
WithGRPC registers the gRPC-server for use in Serve().
WithGracePeriod sets the wait duration for graceful shutdown.
WithHTTP registers the http-server for use in Serve().
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.