{"modulePath":"github.com/codepope/cockroach","version":"v0.0.0-20160610015449-872dfdca98e5","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package pgwire\n\n## Constants\n\n```go\nconst (\n\t// ErrSSLRequired is returned when a client attempts to connect to a\n\t// secure server in cleartext.\n\tErrSSLRequired = \"cleartext connections are not permitted\"\n\n\t// ErrDraining is returned when a client attempts to connect to a server\n\t// which is not accepting client connections.\n\tErrDraining = \"server is not accepting clients\"\n)\n```\n\n## Functions\n\n```go\nfunc Match(rd io.Reader) bool\n```\nMatch returns true if rd appears to be a Postgres connection.\n\n## Types\n\n```go\ntype Server struct {\n\t// contains filtered or unexported fields\n}\n```\nServer implements the server side of the PostgreSQL wire protocol.\n\n```go\nfunc MakeServer(context *base.Context, executor *sql.Executor, reg *metric.Registry) *Server\n```\nMakeServer creates a Server, adding network stats to the given Registry.\n\n```go\nfunc (s *Server) IsDraining() bool\n```\nIsDraining returns true if the server is not currently accepting connections.\n\n```go\nfunc (s *Server) Registry() *metric.Registry\n```\nRegistry returns a registry with the metrics tracked by this server, which can be used to access its stats or be added to another registry.\n\n```go\nfunc (s *Server) ServeConn(conn net.Conn) error\n```\nServeConn serves a single connection, driving the handshake process and delegating to the appropriate connection type.\n\n```go\nfunc (s *Server) SetDraining(drain bool) error\n```\nSetDraining (when called with 'true') prevents new connections from being served and waits a reasonable amount of time for open connections to terminate. If an error is returned, the server remains 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.\n\n","path":"github.com/codepope/cockroach/sql/pgwire","name":"pgwire","synopsis":"","isRedistributable":true}
