cockroach: github.com/abhinavdahiya/cockroach/sql/pgwire Index | Files | Directories

package pgwire

import "github.com/abhinavdahiya/cockroach/sql/pgwire"

Index

Package Files

clientmessagetype_string.go encoding.go formatcode_string.go pgnumericsign_string.go preparetype_string.go server.go servererrfieldtype_string.go servermessagetype_string.go types.go v3.go

Constants

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"
)

func Match Uses

func Match(rd io.Reader) bool

Match returns true if rd appears to be a Postgres connection.

type Server Uses

type Server struct {
    // contains filtered or unexported fields
}

Server implements the server side of the PostgreSQL wire protocol.

func MakeServer Uses

func MakeServer(context *base.Context, executor *sql.Executor, reg *metric.Registry) *Server

MakeServer creates a Server, adding network stats to the given Registry.

func (*Server) IsDraining Uses

func (s *Server) IsDraining() bool

IsDraining returns true if the server is not currently accepting connections.

func (*Server) Registry Uses

func (s *Server) Registry() *metric.Registry

Registry returns a registry with the metrics tracked by this server, which can be used to access its stats or be added to another registry.

func (*Server) ServeConn Uses

func (s *Server) ServeConn(conn net.Conn) error

ServeConn serves a single connection, driving the handshake process and delegating to the appropriate connection type.

func (*Server) SetDraining Uses

func (s *Server) SetDraining(drain bool) error

SetDraining (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.

Directories

PathSynopsis
pgerror

Package pgwire imports 30 packages (graph). Updated 2017-03-13. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).