Documentation ¶
Index ¶
- Constants
- type BindExecResponse
- type Client
- func (c *Client) AutoSSL() (err error)
- func (c *Client) BindExec(name string, args []driver.Value) (res BindExecResponse, err error)
- func (c *Client) CancelRequest() (err error)
- func (c *Client) CloseParse(name string) (err error)
- func (c *Client) Connect(ctx context.Context, dsn DataSourceName) (err error)
- func (c *Client) GetNotification() (pid uint32, channel, message string, err error)
- func (c *Client) IsInTransaction() bool
- func (c *Client) Listen(channel string) (err error)
- func (c *Client) Parse(name, query string) (res ParseResponse, err error)
- func (c *Client) QueryNoArgs(query string) (res SimpleQueryResponse, err error)
- func (c *Client) Startup() (err error)
- func (c *Client) Terminate() (err error)
- func (c *Client) TestConn() ([]byte, error)
- type ConnectStatus
- type DataSourceName
- type NotificationHandler
- type ParseResponse
- type SimpleQueryResponse
Constants ¶
View Source
const ( ConnectStatusConnecting = iota ConnectStatusConnected ConnectStatusDisconnected )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BindExecResponse ¶
type BindExecResponse struct { DataRows []*frame.DataRow Completion *frame.CommandCompletion }
type Client ¶
type Client struct { Dsn DataSourceName // 数据源 Location *time.Location // 服务器端的时区 ConnectStatus ConnectStatus // 连接状态 // contains filtered or unexported fields }
func (*Client) CancelRequest ¶
CancelRequest 建立新连接,使用PID+口令从新连接中发出指令
func (*Client) CloseParse ¶
func (*Client) Connect ¶
func (c *Client) Connect(ctx context.Context, dsn DataSourceName) (err error)
func (*Client) GetNotification ¶
func (*Client) IsInTransaction ¶
func (*Client) QueryNoArgs ¶
func (c *Client) QueryNoArgs(query string) (res SimpleQueryResponse, err error)
type ConnectStatus ¶
type ConnectStatus int
type DataSourceName ¶
type DataSourceName struct { Host string Port string Password string ConnectTimeout time.Duration Parameter map[string]string SSL struct { Mode string Cert string Key string RootCert string Crl string Compression int } }
func ParseDSN ¶
func ParseDSN(connectStr string) (dsn DataSourceName, err error)
func (*DataSourceName) Address ¶
func (dsn *DataSourceName) Address() (network, address string, timeout time.Duration)
func (*DataSourceName) SSLCheck ¶
func (dsn *DataSourceName) SSLCheck() (err error)
type NotificationHandler ¶
type ParseResponse ¶
type ParseResponse struct { Parameters *frame.ParameterDescription Rows *frame.RowDescription }
type SimpleQueryResponse ¶
type SimpleQueryResponse struct { ParseResponse BindExecResponse }
Click to show internal directories.
Click to hide internal directories.