proto

package
v0.0.0-...-685946b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2013 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeBindVariablesBson

func DecodeBindVariablesBson(buf *bytes.Buffer, kind byte) (bindVars map[string]interface{})

func DecodeResultsBson

func DecodeResultsBson(buf *bytes.Buffer, kind byte) (results []mproto.QueryResult)

func EncodeBindVariablesBson

func EncodeBindVariablesBson(buf *bytes2.ChunkedWriter, key string, bindVars map[string]interface{})

func EncodeQueriesBson

func EncodeQueriesBson(queries []BoundQuery, key string, buf *bytes2.ChunkedWriter)

func EncodeResultsBson

func EncodeResultsBson(results []mproto.QueryResult, key string, buf *bytes2.ChunkedWriter)

func RegisterAuthenticated

func RegisterAuthenticated(sqlQuery SqlQuery)

helper method to register the server (does interface checking)

Types

type BoundQuery

type BoundQuery struct {
	Sql           string
	BindVariables map[string]interface{}
}

func DecodeQueriesBson

func DecodeQueriesBson(buf *bytes.Buffer, kind byte) (queries []BoundQuery)

func (*BoundQuery) MarshalBson

func (bdq *BoundQuery) MarshalBson(buf *bytes2.ChunkedWriter)

func (*BoundQuery) UnmarshalBson

func (bdq *BoundQuery) UnmarshalBson(buf *bytes.Buffer)

type ConnectionInfo

type ConnectionInfo struct {
	ConnectionId int64
}

type DDLInvalidate

type DDLInvalidate struct {
	DDL string
}

type DmlType

type DmlType struct {
	Table string
	Keys  []string
}

type Query

type Query struct {
	Sql           string
	BindVariables map[string]interface{}
	TransactionId int64
	ConnectionId  int64
	SessionId     int64
}

func (*Query) MarshalBson

func (query *Query) MarshalBson(buf *bytes2.ChunkedWriter)

func (*Query) String

func (query *Query) String() string

String prints a readable version of Query, and also truncates data if it's too long

func (*Query) UnmarshalBson

func (query *Query) UnmarshalBson(buf *bytes.Buffer)

type QueryList

type QueryList struct {
	Queries       []BoundQuery
	TransactionId int64
	ConnectionId  int64
	SessionId     int64
}

func (*QueryList) MarshalBson

func (ql *QueryList) MarshalBson(buf *bytes2.ChunkedWriter)

func (*QueryList) UnmarshalBson

func (ql *QueryList) UnmarshalBson(buf *bytes.Buffer)

type QueryResultList

type QueryResultList struct {
	List []mproto.QueryResult
}

func (*QueryResultList) MarshalBson

func (qrl *QueryResultList) MarshalBson(buf *bytes2.ChunkedWriter)

func (*QueryResultList) UnmarshalBson

func (qrl *QueryResultList) UnmarshalBson(buf *bytes.Buffer)

type Session

type Session struct {
	TransactionId int64
	ConnectionId  int64
	SessionId     int64
}

func (*Session) MarshalBson

func (session *Session) MarshalBson(buf *bytes2.ChunkedWriter)

func (*Session) UnmarshalBson

func (session *Session) UnmarshalBson(buf *bytes.Buffer)

type SessionInfo

type SessionInfo struct {
	SessionId int64
}

type SessionParams

type SessionParams struct {
	Keyspace string
	Shard    string
}

type SqlQuery

type SqlQuery interface {
	GetSessionId(sessionParams *SessionParams, sessionInfo *SessionInfo) error

	// FIXME(sugu) Note the client will support both returning an
	// int64 or a structure. Using the structure will be rolled
	// out after the client is rolled out.
	Begin(context *rpcproto.Context, session *Session, txInfo *TransactionInfo) error
	Commit(context *rpcproto.Context, session *Session, noOutput *string) error
	Rollback(context *rpcproto.Context, session *Session, noOutput *string) error

	CreateReserved(session *Session, connectionInfo *ConnectionInfo) error
	CloseReserved(session *Session, noOutput *string) error

	Execute(context *rpcproto.Context, query *Query, reply *mproto.QueryResult) error
	StreamExecute(context *rpcproto.Context, query *Query, sendReply func(reply interface{}) error) error
	ExecuteBatch(context *rpcproto.Context, queryList *QueryList, reply *QueryResultList) error
}

defines the RPC services the service name to use is 'SqlQuery'

type TransactionInfo

type TransactionInfo struct {
	TransactionId int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL