- func Match(rd io.Reader) bool
- type Server
- type ServerMetrics
const ( // ErrSSLRequired is returned when a client attempts to connect to a // secure server in cleartext. ErrSSLRequired = "cleartext connections are not permitted" // ErrDraining is returned when a client attempts to connect to a server // which is not accepting client connections. ErrDraining = "server is not accepting clients" )
Fully-qualified names for metrics.
Server implements the server side of the PostgreSQL wire protocol.
func MakeServer ¶
func MakeServer( ambientCtx log.AmbientContext, cfg *base.Config, executor *sql.Executor, internalMemMetrics *sql.MemoryMetrics, parentMemoryMonitor *mon.MemoryMonitor, histogramWindow time.Duration, ) *Server
MakeServer creates a Server.
func (*Server) IsDraining ¶
IsDraining returns true if the server is not currently accepting connections.
Metrics returns the metrics struct.
ServeConn serves a single connection, driving the handshake process and delegating to the appropriate connection type.
func (*Server) SetDraining ¶
SetDraining (when called with 'true') prevents new connections from being served and waits a reasonable amount of time for open connections to terminate before canceling them. An error will be returned when connections that have been cancelled have not responded to this cancellation and closed themselves in time. The server will remain in draining state, though open connections may continue to exist. When called with 'false', switches back to the normal mode of operation in which connections are accepted. The RFC on drain modes has more information regarding the specifics of what will happen to connections in different states: https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/drain_modes.md