tcpserver

package
v0.0.0-...-1b33b2a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TCPServer

type TCPServer interface {
	// Run runs the TCPServer.
	// For a given instance of TCPServer, Run is expected
	// to be called only once.
	Run(ctx context.Context) error
	// GrpcListener returns the gRPC listener that
	// can be listened on by a gRPC server.
	GrpcListener() net.Listener
	// HTTP1Listener returns a plain HTTP listener.
	HTTP1Listener() net.Listener
	// IsTLSEnabled returns whether TLS has been enabled.
	IsTLSEnabled() bool
	// Close closed the TCPServer.
	// The listeners returned by GrpcListener and HTTP1Listener
	// will be closed, which will force the consumers of these
	// listeners to stop. This provides a reliable mechanism to
	// cancel all related components.
	Close() error
}

TCPServer provides a muxed socket that can serve both plain HTTP and gRPC at the same time.

func NewTCPServer

func NewTCPServer(address string, credentials *security.Credential) (TCPServer, error)

NewTCPServer creates a new TCPServer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL