Versions in this module Expand all Collapse all v0 v0.9.0 Jun 15, 2015 Changes in this version + const BatchSizeMaximum + const CLUSTERING_KEY + const COLLECTION_TYPE + const COMPOSITE_TYPE + const CounterBatch + const DEFAULT_COLUMN_ALIAS + const DEFAULT_KEY_ALIAS + const DEFAULT_VALUE_ALIAS + const LIST_TYPE + const LoggedBatch + const MAP_TYPE + const PARTITION_KEY + const REGULAR + const REVERSED_TYPE + const SET_TYPE + const TypeAscii + const TypeBigInt + const TypeBlob + const TypeBoolean + const TypeCounter + const TypeCustom + const TypeDecimal + const TypeDouble + const TypeFloat + const TypeInet + const TypeInt + const TypeList + const TypeMap + const TypeSet + const TypeTimeUUID + const TypeTimestamp + const TypeTuple + const TypeUDT + const TypeUUID + const TypeVarchar + const TypeVarint + const UnloggedBatch + const VariantFuture + const VariantIETF + const VariantMicrosoft + const VariantNCSCompat + var ErrFrameTooBig = errors.New("frame length is bigger than the maximum alowed") + var ErrHostQueryFailed = errors.New("unable to populate Hosts") + var ErrNoConnections = errors.New("no connections available") + var ErrNoConnectionsStarted = errors.New("no connections were made when creating the session") + var ErrNoHosts = errors.New("no hosts provided") + var ErrNoKeyspace = errors.New("no keyspace provided") + var ErrNoMetadata = errors.New("no metadata available") + var ErrNotFound = errors.New("not found") + var ErrQueryArgLength = errors.New("query argument length mismatch") + var ErrSessionClosed = errors.New("session has been closed") + var ErrTooManyStmts = errors.New("too many statements") + var ErrUnavailable = errors.New("unavailable") + var ErrUnsupported = errors.New("feature not supported") + var ErrUseStmt = errors.New(...) + var ErrorUDTUnavailable = errors.New("UDT are not available on protocols less than 3, please update config") + func JoinHostPort(addr string, port int) string + func Marshal(info TypeInfo, value interface{}) ([]byte, error) + func NewErrProtocol(format string, args ...interface{}) error + func Unmarshal(info TypeInfo, data []byte, value interface{}) error + type Authenticator interface + Challenge func(req []byte) (resp []byte, auth Authenticator, err error) + Success func(data []byte) error + type Batch struct + Cons Consistency + Entries []BatchEntry + Type BatchType + func NewBatch(typ BatchType) *Batch + func (b *Batch) Attempts() int + func (b *Batch) Bind(stmt string, bind func(q *QueryInfo) ([]interface{}, error)) + func (b *Batch) DefaultTimestamp(enable bool) *Batch + func (b *Batch) GetConsistency() Consistency + func (b *Batch) Latency() int64 + func (b *Batch) Query(stmt string, args ...interface{}) + func (b *Batch) RetryPolicy(r RetryPolicy) *Batch + func (b *Batch) SerialConsistency(cons SerialConsistency) *Batch + func (b *Batch) Size() int + type BatchEntry struct + Args []interface{} + Stmt string + type BatchType byte + type ClusterConfig struct + Authenticator Authenticator + CQLVersion string + Compressor Compressor + ConnPoolType NewPoolFunc + Consistency Consistency + DefaultTimestamp bool + DiscoverHosts bool + Discovery DiscoveryConfig + Hosts []string + Keyspace string + MaxPreparedStmts int + MaxRoutingKeyInfo int + NumConns int + NumStreams int + PageSize int + Port int + ProtoVersion int + RetryPolicy RetryPolicy + SerialConsistency SerialConsistency + SocketKeepalive time.Duration + SslOpts *SslOptions + Timeout time.Duration + func NewCluster(hosts ...string) *ClusterConfig + func (cfg *ClusterConfig) CreateSession() (*Session, error) + type CollectionType struct + Elem TypeInfo + Key TypeInfo + func (c CollectionType) String() string + func (t CollectionType) New() interface{} + type ColumnIndexMetadata struct + Name string + Options map[string]interface{} + Type string + type ColumnInfo struct + Keyspace string + Name string + Table string + TypeInfo TypeInfo + func (c ColumnInfo) String() string + type ColumnMetadata struct + ComponentIndex int + Index ColumnIndexMetadata + Keyspace string + Kind string + Name string + Order ColumnOrder + Table string + Type TypeInfo + Validator string + type ColumnOrder bool + const ASC + const DESC + type Compressor interface + Decode func(data []byte) ([]byte, error) + Encode func(data []byte) ([]byte, error) + Name func() string + type Conn struct + func Connect(addr string, cfg ConnConfig, errorHandler ConnErrorHandler) (*Conn, error) + func (c *Conn) Address() string + func (c *Conn) AvailableStreams() int + func (c *Conn) Close() + func (c *Conn) Closed() bool + func (c *Conn) Pick(qry *Query) *Conn + func (c *Conn) Read(p []byte) (n int, err error) + func (c *Conn) UseKeyspace(keyspace string) error + func (c *Conn) Write(p []byte) (int, error) + type ConnConfig struct + Authenticator Authenticator + CQLVersion string + Compressor Compressor + Keepalive time.Duration + NumStreams int + ProtoVersion int + Timeout time.Duration + type ConnErrorHandler interface + HandleError func(conn *Conn, err error, closed bool) + type ConnSelectionPolicy interface + Pick func(*Query) *Conn + SetConns func(conns []*Conn) + func NewRoundRobinConnPolicy() ConnSelectionPolicy + type ConnectionPool interface + Close func() + Pick func(*Query) *Conn + Size func() int + func NewPolicyConnPool(cfg *ClusterConfig, hostPolicy HostSelectionPolicy, ...) (ConnectionPool, error) + func NewRoundRobinConnPool(cfg *ClusterConfig) (ConnectionPool, error) + func NewSimplePool(cfg *ClusterConfig) (ConnectionPool, error) + func NewTokenAwareConnPool(cfg *ClusterConfig) (ConnectionPool, error) + type Consistency uint16 + const All + const Any + const EachQuorum + const LocalOne + const LocalQuorum + const One + const Quorum + const Three + const Two + func (c Consistency) String() string + type DiscoveryConfig struct + DcFilter string + RackFilter string + Sleep time.Duration + type ErrProtocol struct + type Error struct + Code int + Message string + func (e Error) Error() string + type HostInfo struct + DataCenter string + HostId string + Peer string + Rack string + Tokens []string + type HostSelectionPolicy interface + Pick func(*Query) NextHost + func NewRoundRobinHostPolicy() HostSelectionPolicy + func NewTokenAwareHostPolicy(fallback HostSelectionPolicy) HostSelectionPolicy + type Iter struct + func (iter *Iter) Close() error + func (iter *Iter) Columns() []ColumnInfo + func (iter *Iter) MapScan(m map[string]interface{}) bool + func (iter *Iter) RowData() (RowData, error) + func (iter *Iter) Scan(dest ...interface{}) bool + func (iter *Iter) SliceMap() ([]map[string]interface{}, error) + type KeyspaceMetadata struct + DurableWrites bool + Name string + StrategyClass string + StrategyOptions map[string]interface{} + Tables map[string]*TableMetadata + type MarshalError string + func (m MarshalError) Error() string + type Marshaler interface + MarshalCQL func(info TypeInfo) ([]byte, error) + type NativeType struct + func (s NativeType) Custom() string + func (s NativeType) String() string + func (s NativeType) Type() Type + func (s NativeType) Version() byte + func (t NativeType) New() interface{} + type NewPoolFunc func(*ClusterConfig) (ConnectionPool, error) + type NextHost func() *HostInfo + type Node interface + Close func() + Pick func(qry *Query) *Conn + type PasswordAuthenticator struct + Password string + Username string + func (p PasswordAuthenticator) Challenge(req []byte) ([]byte, Authenticator, error) + func (p PasswordAuthenticator) Success(data []byte) error + type Query struct + func (q *Query) Attempts() int + func (q *Query) Bind(v ...interface{}) *Query + func (q *Query) Consistency(c Consistency) *Query + func (q *Query) DefaultTimestamp(enable bool) *Query + func (q *Query) Exec() error + func (q *Query) GetConsistency() Consistency + func (q *Query) GetRoutingKey() ([]byte, error) + func (q *Query) Iter() *Iter + func (q *Query) Latency() int64 + func (q *Query) MapScan(m map[string]interface{}) error + func (q *Query) MapScanCAS(dest map[string]interface{}) (applied bool, err error) + func (q *Query) PageSize(n int) *Query + func (q *Query) Prefetch(p float64) *Query + func (q *Query) RetryPolicy(r RetryPolicy) *Query + func (q *Query) RoutingKey(routingKey []byte) *Query + func (q *Query) Scan(dest ...interface{}) error + func (q *Query) ScanCAS(dest ...interface{}) (applied bool, err error) + func (q *Query) SerialConsistency(cons SerialConsistency) *Query + func (q *Query) Trace(trace Tracer) *Query + type QueryInfo struct + Args []ColumnInfo + Id []byte + Rval []ColumnInfo + type RequestErrAlreadyExists struct + Keyspace string + Table string + func (e RequestErrAlreadyExists) Code() int + func (e RequestErrAlreadyExists) Error() string + func (e RequestErrAlreadyExists) Message() string + func (e RequestErrAlreadyExists) String() string + type RequestErrReadTimeout struct + BlockFor int + Consistency Consistency + DataPresent byte + Received int + func (e RequestErrReadTimeout) Code() int + func (e RequestErrReadTimeout) Error() string + func (e RequestErrReadTimeout) Message() string + func (e RequestErrReadTimeout) String() string + type RequestErrUnavailable struct + Alive int + Consistency Consistency + Required int + func (e *RequestErrUnavailable) String() string + func (e RequestErrUnavailable) Code() int + func (e RequestErrUnavailable) Error() string + func (e RequestErrUnavailable) Message() string + type RequestErrUnprepared struct + StatementId []byte + func (e RequestErrUnprepared) Code() int + func (e RequestErrUnprepared) Error() string + func (e RequestErrUnprepared) Message() string + func (e RequestErrUnprepared) String() string + type RequestErrWriteTimeout struct + BlockFor int + Consistency Consistency + Received int + WriteType string + func (e RequestErrWriteTimeout) Code() int + func (e RequestErrWriteTimeout) Error() string + func (e RequestErrWriteTimeout) Message() string + func (e RequestErrWriteTimeout) String() string + type RequestError interface + Code func() int + Error func() string + Message func() string + type RetryPolicy interface + Attempt func(RetryableQuery) bool + type RetryableQuery interface + Attempts func() int + GetConsistency func() Consistency + type RoundRobin struct + func NewRoundRobin() *RoundRobin + func (r *RoundRobin) AddNode(node Node) + func (r *RoundRobin) Close() + func (r *RoundRobin) Pick(qry *Query) *Conn + func (r *RoundRobin) RemoveNode(node Node) + func (r *RoundRobin) Size() int + type RowData struct + Columns []string + Values []interface{} + type SerialConsistency uint16 + const LocalSerial + const Serial + func (s SerialConsistency) String() string + type Session struct + Pool ConnectionPool + func NewSession(cfg ClusterConfig) (*Session, error) + func (s *Session) Bind(stmt string, b func(q *QueryInfo) ([]interface{}, error)) *Query + func (s *Session) Close() + func (s *Session) Closed() bool + func (s *Session) ExecuteBatch(batch *Batch) error + func (s *Session) KeyspaceMetadata(keyspace string) (*KeyspaceMetadata, error) + func (s *Session) NewBatch(typ BatchType) *Batch + func (s *Session) Query(stmt string, values ...interface{}) *Query + func (s *Session) SetConsistency(cons Consistency) + func (s *Session) SetPageSize(n int) + func (s *Session) SetPrefetch(p float64) + func (s *Session) SetTrace(trace Tracer) + type SetHosts interface + SetHosts func(hosts []HostInfo) + type SetPartitioner interface + SetPartitioner func(partitioner string) + type SimplePool struct + func (c *SimplePool) Close() + func (c *SimplePool) HandleError(conn *Conn, err error, closed bool) + func (c *SimplePool) Pick(qry *Query) *Conn + func (c *SimplePool) SetHosts(hosts []HostInfo) + func (p *SimplePool) Size() int + type SimpleRetryPolicy struct + NumRetries int + func (s *SimpleRetryPolicy) Attempt(q RetryableQuery) bool + type SnappyCompressor struct + func (s SnappyCompressor) Decode(data []byte) ([]byte, error) + func (s SnappyCompressor) Encode(data []byte) ([]byte, error) + func (s SnappyCompressor) Name() string + type SslOptions struct + CaPath string + CertPath string + EnableHostVerification bool + KeyPath string + type TableMetadata struct + ClusteringColumns []*ColumnMetadata + ColumnAliases []string + Columns map[string]*ColumnMetadata + Comparator string + DefaultValidator string + KeyAliases []string + KeyValidator string + Keyspace string + Name string + PartitionKey []*ColumnMetadata + ValueAlias string + type Tracer interface + Trace func(traceId []byte) + func NewTraceWriter(session *Session, w io.Writer) Tracer + type TupleTypeInfo struct + Elems []TypeInfo + type Type int + func (t Type) String() string + type TypeInfo interface + Custom func() string + New func() interface{} + Type func() Type + Version func() byte + type UDTField struct + Name string + Type TypeInfo + type UDTMarshaler interface + MarshalUDT func(name string, info TypeInfo) ([]byte, error) + type UDTTypeInfo struct + Elements []UDTField + KeySpace string + Name string + func (u UDTTypeInfo) String() string + type UDTUnmarshaler interface + UnmarshalUDT func(name string, info TypeInfo, data []byte) error + type UUID [16]byte + func ParseUUID(input string) (UUID, error) + func RandomUUID() (UUID, error) + func TimeUUID() UUID + func UUIDFromBytes(input []byte) (UUID, error) + func UUIDFromTime(aTime time.Time) UUID + func (u *UUID) UnmarshalJSON(data []byte) error + func (u UUID) Bytes() []byte + func (u UUID) MarshalJSON() ([]byte, error) + func (u UUID) Node() []byte + func (u UUID) String() string + func (u UUID) Time() time.Time + func (u UUID) Timestamp() int64 + func (u UUID) Variant() int + func (u UUID) Version() int + type UnmarshalError string + func (m UnmarshalError) Error() string + type Unmarshaler interface + UnmarshalCQL func(info TypeInfo, data []byte) error