Documentation
¶
Index ¶
- func ClientTLSConfig(sslCert, sslKey, sslCA string) (*tls.Config, error)
- func RunGRPCServerWithContext(ctx context.Context, server *grpc.Server, addr string) error
- func RunHTTPServerWithContext(ctx context.Context, server *http.Server) error
- func ServerTLSConfig(sslCert, sslKey, sslCA string) (*tls.Config, error)
- type GRPCEndpointSpec
- type GRPCServerSpec
- type LineConn
- type SocketHandler
- type SocketServer
- type TLSParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunGRPCServerWithContext ¶
Run a GRPC server controlled by a Context.
func RunHTTPServerWithContext ¶
Run a HTTP server controlled by a Context.
Types ¶
type GRPCEndpointSpec ¶
type GRPCEndpointSpec struct { TLSParams `yaml:",inline"` Addr string `yaml:"addr" doc:"GRPC endpoint (host:port)"` ServiceConfigJSON string `yaml:"service_config" doc:"additional GRPC client config (JSON-encoded)"` // contains filtered or unexported fields }
func (*GRPCEndpointSpec) Dial ¶
func (e *GRPCEndpointSpec) Dial(opts ...grpc.DialOption) (*grpc.ClientConn, error)
func (*GRPCEndpointSpec) DialOptions ¶
func (e *GRPCEndpointSpec) DialOptions() ([]grpc.DialOption, error)
func (*GRPCEndpointSpec) DialShard ¶
func (e *GRPCEndpointSpec) DialShard(shard string, opts ...grpc.DialOption) (*grpc.ClientConn, error)
type GRPCServerSpec ¶
func (*GRPCServerSpec) ServerOptions ¶
func (s *GRPCServerSpec) ServerOptions() ([]grpc.ServerOption, *grpcprom.ServerMetrics, error)
type LineConn ¶
type LineConn struct { net.Conn WriteTimeout time.Duration ReadTimeout time.Duration // contains filtered or unexported fields }
A LineConn is just a slightly improved net/textproto.Conn, with timeout support and a byte-oriented API.
func NewLineConn ¶
NewLineConn creates a new LineConn. As opposed to the textproto.Conn, LineConn owns the net.Conn so you should call Close() on it and not on the original connection.
type SocketHandler ¶
Handler for UNIX socket server connections.
type SocketServer ¶
type SocketServer struct {
// contains filtered or unexported fields
}
SocketServer accepts connections on a UNIX socket, speaking the line-based wire protocol, and dispatches incoming requests to the wrapped Server.
func NewSystemdSocketServer ¶
func NewSystemdSocketServer(h SocketHandler) (*SocketServer, error)
NewSystemdSocketServer uses systemd socket activation, receiving the open socket as a file descriptor on exec.
func NewUNIXSocketServer ¶
func NewUNIXSocketServer(socketPath string, h SocketHandler) (*SocketServer, error)
NewUNIXSocketServer returns a new SocketServer listening on the given path.
func (*SocketServer) Close ¶
func (s *SocketServer) Close()
Close the socket listener and release all associated resources. Waits for active connections to terminate before returning.