proto

package
v0.0.0-...-7c5168d Latest Latest
Warning

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

Go to latest
Published: Oct 19, 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 EncodeBindVariablesBson

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

func RegisterAuthenticated

func RegisterAuthenticated(sqlQuery SqlQuery)

helper method to register the server (does interface checking)

Types

type CacheInvalidate

type CacheInvalidate struct {
	Dmls []DmlType
}

type ConnectionInfo

type ConnectionInfo struct {
	ConnectionId int64
}

type DDLInvalidate

type DDLInvalidate struct {
	DDL string
}

type DmlType

type DmlType struct {
	Table string
	Keys  []interface{}
}

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 {
	List []Query
}

type QueryResultList

type QueryResultList struct {
	List []mproto.QueryResult
}

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