Documentation ¶
Index ¶
- Variables
- func GetMockAddress() string
- func ParseInstance(instance string) (map[string]string, error)
- type CancellableConnection
- func (cc *CancellableConnection) Close() error
- func (cc *CancellableConnection) LocalAddr() net.Addr
- func (cc *CancellableConnection) Read(p []byte) (int, error)
- func (cc *CancellableConnection) RemoteAddr() net.Addr
- func (cc *CancellableConnection) SetDeadline(t time.Time) error
- func (cc *CancellableConnection) SetReadDeadline(t time.Time) error
- func (cc *CancellableConnection) SetWriteDeadline(t time.Time) error
- func (cc *CancellableConnection) Write(p []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidDatabaseInstance = errors.New("invalid database instance")
ErrInvalidDatabaseInstance is returned when a malformed database instance is supplied.
Functions ¶
func GetMockAddress ¶
func GetMockAddress() string
GetMockAddress is used by the tests to determine the address of the Google API mock.
Types ¶
type CancellableConnection ¶
type CancellableConnection struct {
// contains filtered or unexported fields
}
CancellableConnection is a context.Context aware network connection.
func MakeCancellable ¶
func MakeCancellable(ctx context.Context, conn net.Conn) *CancellableConnection
MakeCancellable converts a net.Conn into a cancellable connection.
func (*CancellableConnection) Close ¶
func (cc *CancellableConnection) Close() error
Close closes the connection.
func (*CancellableConnection) LocalAddr ¶
func (cc *CancellableConnection) LocalAddr() net.Addr
LocalAddr returns the local network address.
func (*CancellableConnection) Read ¶
func (cc *CancellableConnection) Read(p []byte) (int, error)
Read reads an array of bytes from the connection.
func (*CancellableConnection) RemoteAddr ¶
func (cc *CancellableConnection) RemoteAddr() net.Addr
RemoteAddr returns the remote network address.
func (*CancellableConnection) SetDeadline ¶
func (cc *CancellableConnection) SetDeadline(t time.Time) error
SetDeadline sets the read and write deadlines associated with the connection.
func (*CancellableConnection) SetReadDeadline ¶
func (cc *CancellableConnection) SetReadDeadline(t time.Time) error
SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call.
func (*CancellableConnection) SetWriteDeadline ¶
func (cc *CancellableConnection) SetWriteDeadline(t time.Time) error
SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call.