Documentation
¶
Overview ¶
Package driver is a generated protocol buffer package.
It is generated from these files:
cockroach/sql/driver/wire.proto
It has these top-level messages:
Datum Result Request Response
Index ¶
- Constants
- Variables
- func RegisterSender(scheme string, f NewSenderFunc)
- type Datum
- func (m *Datum) GetBoolVal() bool
- func (m *Datum) GetBytesVal() []byte
- func (m *Datum) GetFloatVal() float64
- func (m *Datum) GetIntVal() int64
- func (m *Datum) GetPayload() isDatum_Payload
- func (m *Datum) GetStringVal() string
- func (m *Datum) GetTimeVal() *Datum_Timestamp
- func (m *Datum) Marshal() (data []byte, err error)
- func (m *Datum) MarshalTo(data []byte) (int, error)
- func (*Datum) ProtoMessage()
- func (m *Datum) Reset()
- func (m *Datum) Size() (n int)
- func (d Datum) String() string
- func (m *Datum) Unmarshal(data []byte) error
- func (d Datum) Value() (driver.Value, error)
- func (*Datum) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type Datum_BoolVal
- type Datum_BytesVal
- type Datum_FloatVal
- type Datum_IntVal
- type Datum_StringVal
- type Datum_TimeVal
- type Datum_Timestamp
- func (m *Datum_Timestamp) GetNsec() uint32
- func (m *Datum_Timestamp) GetSec() int64
- func (t Datum_Timestamp) GoTime() time.Time
- func (m *Datum_Timestamp) Marshal() (data []byte, err error)
- func (m *Datum_Timestamp) MarshalTo(data []byte) (int, error)
- func (*Datum_Timestamp) ProtoMessage()
- func (m *Datum_Timestamp) Reset()
- func (m *Datum_Timestamp) Size() (n int)
- func (m *Datum_Timestamp) String() string
- func (m *Datum_Timestamp) Unmarshal(data []byte) error
- type Method
- type NewSenderFunc
- type Request
- func (Request) CreateReply() Response
- func (m *Request) GetParams() []Datum
- func (m *Request) GetSession() []byte
- func (m *Request) GetSql() string
- func (m *Request) GetUser() string
- func (m *Request) Marshal() (data []byte, err error)
- func (m *Request) MarshalTo(data []byte) (int, error)
- func (Request) Method() Method
- func (*Request) ProtoMessage()
- func (m *Request) Reset()
- func (m *Request) Size() (n int)
- func (m *Request) String() string
- func (m *Request) Unmarshal(data []byte) error
- type Response
- func (m *Response) GetResults() []Result
- func (m *Response) GetSession() []byte
- func (m *Response) Marshal() (data []byte, err error)
- func (m *Response) MarshalTo(data []byte) (int, error)
- func (*Response) ProtoMessage()
- func (m *Response) Reset()
- func (m *Response) Size() (n int)
- func (m *Response) String() string
- func (m *Response) Unmarshal(data []byte) error
- type Result
- func (m *Result) GetColumns() []string
- func (m *Result) GetError() string
- func (m *Result) GetRows() []Result_Row
- func (m *Result) Marshal() (data []byte, err error)
- func (m *Result) MarshalTo(data []byte) (int, error)
- func (*Result) ProtoMessage()
- func (m *Result) Reset()
- func (m *Result) Size() (n int)
- func (m *Result) String() string
- func (m *Result) Unmarshal(data []byte) error
- type Result_Row
- func (m *Result_Row) GetValues() []Datum
- func (m *Result_Row) Marshal() (data []byte, err error)
- func (m *Result_Row) MarshalTo(data []byte) (int, error)
- func (*Result_Row) ProtoMessage()
- func (m *Result_Row) Reset()
- func (m *Result_Row) Size() (n int)
- func (m *Result_Row) String() string
- func (m *Result_Row) Unmarshal(data []byte) error
- type Sender
Constants ¶
View Source
const ( // Endpoint is the URL path prefix which accepts incoming // HTTP requests for the SQL API. Endpoint = "/sql/" )
View Source
const ( // StatusTooManyRequests indicates client should retry due to // server having too many requests. StatusTooManyRequests = 429 )
Variables ¶
View Source
var ( ErrInvalidLengthWire = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowWire = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterSender ¶
func RegisterSender(scheme string, f NewSenderFunc)
RegisterSender registers the specified function to be used for creation of a new sender when the specified scheme is encountered.
Types ¶
type Datum ¶
type Datum struct {
// Using explicit proto types provides convenient access when using json. If
// we used a Kind+Bytes approach the json interface would involve base64
// encoded data.
//
// Types that are valid to be assigned to Payload:
// *Datum_BoolVal
// *Datum_IntVal
// *Datum_FloatVal
// *Datum_BytesVal
// *Datum_StringVal
// *Datum_TimeVal
Payload isDatum_Payload `protobuf_oneof:"payload"`
}
func (*Datum) GetBoolVal ¶
func (*Datum) GetBytesVal ¶
func (*Datum) GetFloatVal ¶
func (*Datum) GetPayload ¶
func (m *Datum) GetPayload() isDatum_Payload
func (*Datum) GetStringVal ¶
func (*Datum) GetTimeVal ¶
func (m *Datum) GetTimeVal() *Datum_Timestamp
func (*Datum) ProtoMessage ¶
func (*Datum) ProtoMessage()
type Datum_BoolVal ¶
type Datum_BoolVal struct {
BoolVal bool `protobuf:"varint,1,opt,name=bool_val,oneof"`
}
func (*Datum_BoolVal) Size ¶
func (m *Datum_BoolVal) Size() (n int)
type Datum_BytesVal ¶
type Datum_BytesVal struct {
BytesVal []byte `protobuf:"bytes,4,opt,name=bytes_val,oneof"`
}
func (*Datum_BytesVal) Size ¶
func (m *Datum_BytesVal) Size() (n int)
type Datum_FloatVal ¶
type Datum_FloatVal struct {
FloatVal float64 `protobuf:"fixed64,3,opt,name=float_val,oneof"`
}
func (*Datum_FloatVal) Size ¶
func (m *Datum_FloatVal) Size() (n int)
type Datum_IntVal ¶
type Datum_IntVal struct {
IntVal int64 `protobuf:"varint,2,opt,name=int_val,oneof"`
}
func (*Datum_IntVal) Size ¶
func (m *Datum_IntVal) Size() (n int)
type Datum_StringVal ¶
type Datum_StringVal struct {
StringVal string `protobuf:"bytes,5,opt,name=string_val,oneof"`
}
func (*Datum_StringVal) Size ¶
func (m *Datum_StringVal) Size() (n int)
type Datum_TimeVal ¶
type Datum_TimeVal struct {
TimeVal *Datum_Timestamp `protobuf:"bytes,6,opt,name=time_val,oneof"`
}
func (*Datum_TimeVal) Size ¶
func (m *Datum_TimeVal) Size() (n int)
type Datum_Timestamp ¶
type Datum_Timestamp struct {
// The time in seconds since, January 1, 1970 UTC (Unix time).
Sec int64 `protobuf:"varint,1,opt,name=sec" json:"sec"`
// nsec specifies a non-negative nanosecond offset within sec.
// It must be in the range [0, 999999999].
Nsec uint32 `protobuf:"varint,2,opt,name=nsec" json:"nsec"`
}
Timestamp represents an absolute timestamp devoid of time-zone.
func (*Datum_Timestamp) GetNsec ¶
func (m *Datum_Timestamp) GetNsec() uint32
func (*Datum_Timestamp) GetSec ¶
func (m *Datum_Timestamp) GetSec() int64
func (Datum_Timestamp) GoTime ¶
func (t Datum_Timestamp) GoTime() time.Time
GoTime converts the timestamp to a time.Time.
func (*Datum_Timestamp) Marshal ¶
func (m *Datum_Timestamp) Marshal() (data []byte, err error)
func (*Datum_Timestamp) ProtoMessage ¶
func (*Datum_Timestamp) ProtoMessage()
func (*Datum_Timestamp) Reset ¶
func (m *Datum_Timestamp) Reset()
func (*Datum_Timestamp) Size ¶
func (m *Datum_Timestamp) Size() (n int)
func (*Datum_Timestamp) String ¶
func (m *Datum_Timestamp) String() string
func (*Datum_Timestamp) Unmarshal ¶
func (m *Datum_Timestamp) Unmarshal(data []byte) error
type NewSenderFunc ¶
NewSenderFunc creates a new sender for the registered scheme.
type Request ¶
type Request struct {
// User is the originating user.
User string `protobuf:"bytes,1,opt,name=user" json:"user"`
// Session settings that were returned in the last response that
// contained them, being reflected back to the server.
Session []byte `protobuf:"bytes,2,opt,name=session" json:"session,omitempty"`
// SQL statement(s) to be serially executed by the server. Multiple
// statements are passed as a single string separated by semicolons.
Sql string `protobuf:"bytes,3,opt,name=sql" json:"sql"`
// Parameters referred to in the above SQL statement(s) using "?".
Params []Datum `protobuf:"bytes,4,rep,name=params" json:"params"`
}
An SQL request to cockroach. A transaction can consist of multiple requests.
func (Request) CreateReply ¶
CreateReply creates an empty response for the request.
func (*Request) GetSession ¶
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
type Response ¶
type Response struct {
// Setting that should be reflected back in all subsequent requests.
// When not set, future requests should continue to use existing settings.
Session []byte `protobuf:"bytes,1,opt,name=session" json:"session,omitempty"`
// The list of results. There is one result object per SQL statement in the
// request.
Results []Result `protobuf:"bytes,2,rep,name=results" json:"results"`
}
func (*Response) GetResults ¶
func (*Response) GetSession ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
type Result ¶
type Result struct {
// Error is non-nil if an error occurred while executing the statement.
Error *string `protobuf:"bytes,1,opt,name=error" json:"error,omitempty"`
// The names of the columns returned in the result set in the order specified
// in the SQL statement. The number of columns will equal the number of
// values in each Row.
Columns []string `protobuf:"bytes,2,rep,name=columns" json:"columns,omitempty"`
// The rows in the result set.
Rows []Result_Row `protobuf:"bytes,3,rep,name=rows" json:"rows"`
}
A Result is a collection of rows.
func (*Result) GetColumns ¶
func (*Result) GetRows ¶
func (m *Result) GetRows() []Result_Row
func (*Result) ProtoMessage ¶
func (*Result) ProtoMessage()
type Result_Row ¶
type Result_Row struct {
Values []Datum `protobuf:"bytes,1,rep,name=values" json:"values"`
}
A Row is a collection of values representing a row in a result.
func (*Result_Row) GetValues ¶
func (m *Result_Row) GetValues() []Datum
func (*Result_Row) Marshal ¶
func (m *Result_Row) Marshal() (data []byte, err error)
func (*Result_Row) ProtoMessage ¶
func (*Result_Row) ProtoMessage()
func (*Result_Row) Reset ¶
func (m *Result_Row) Reset()
func (*Result_Row) Size ¶
func (m *Result_Row) Size() (n int)
func (*Result_Row) String ¶
func (m *Result_Row) String() string
func (*Result_Row) Unmarshal ¶
func (m *Result_Row) Unmarshal(data []byte) error
Click to show internal directories.
Click to hide internal directories.