Versions in this module Expand all Collapse all v1 v1.0.0 Apr 11, 2017 Changes in this version + const BatchSizeMaximum + const COLLECTION_TYPE + const COMPOSITE_TYPE + const DEFAULT_COLUMN_ALIAS + const DEFAULT_KEY_ALIAS + const DEFAULT_VALUE_ALIAS + const LIST_TYPE + const MAP_TYPE + const NodeDown + const NodeUp + const REVERSED_TYPE + const SET_TYPE + const VariantFuture + const VariantIETF + const VariantMicrosoft + const VariantNCSCompat + var ErrConnectionClosed = errors.New("gocql: connection closed waiting for response") + var ErrFrameTooBig = errors.New("frame length is bigger than the maximum allowed") + var ErrHostQueryFailed = errors.New("unable to populate Hosts") + var ErrKeyspaceDoesNotExist = errors.New("keyspace does not exist") + var ErrNoConnections = errors.New("gocql: no hosts available in the pool") + 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 ErrNoStreams = errors.New("gocql: no streams available on connection") + var ErrNotFound = errors.New("not found") + var ErrQueryArgLength = errors.New("gocql: query argument length mismatch") + var ErrSessionClosed = errors.New("session has been closed") + var ErrTimeoutNoResponse = errors.New("gocql: no response received from cassandra within timeout period") + var ErrTooManyStmts = errors.New("too many statements") + var ErrTooManyTimeouts = errors.New("gocql: too many query timeouts on the connection") + 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") + var TimeoutLimit int64 = 10 + func JoinHostPort(addr string, port int) string + func Marshal(info TypeInfo, value interface{}) ([]byte, error) + func NewErrProtocol(format string, args ...interface{}) error + func TupleColumnName(c string, n int) string + func Unmarshal(info TypeInfo, data []byte, value interface{}) error + type AddressTranslator interface + Translate func(addr net.IP, port int) (net.IP, int) + func IdentityTranslator() AddressTranslator + type AddressTranslatorFunc func(addr net.IP, port int) (net.IP, int) + func (fn AddressTranslatorFunc) Translate(addr net.IP, port int) (net.IP, int) + 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) GetRoutingKey() ([]byte, error) + 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 + func (b *Batch) WithContext(ctx context.Context) *Batch + func (b *Batch) WithTimestamp(timestamp int64) *Batch + type BatchEntry struct + Args []interface{} + Stmt string + type BatchType byte + const CounterBatch + const LoggedBatch + const UnloggedBatch + type ClusterConfig struct + AddressTranslator AddressTranslator + Authenticator Authenticator + CQLVersion string + Compressor Compressor + ConnectTimeout time.Duration + Consistency Consistency + DefaultTimestamp bool + DisableInitialHostLookup bool + DisableSkipMetadata bool + Events struct{ ... } + HostFilter HostFilter + Hosts []string + IgnorePeerAddr bool + Keyspace string + MaxPreparedStmts int + MaxRoutingKeyInfo int + MaxWaitSchemaAgreement time.Duration + NumConns int + PageSize int + PoolConfig PoolConfig + Port int + ProtoVersion int + ReconnectInterval time.Duration + 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 ColumnKind int + const ColumnClusteringKey + const ColumnCompact + const ColumnPartitionKey + const ColumnRegular + const ColumnStatic + const ColumnUnkownKind + func (c *ColumnKind) UnmarshalCQL(typ TypeInfo, p []byte) error + func (c ColumnKind) String() string + type ColumnMetadata struct + ClusteringOrder string + ComponentIndex int + Index ColumnIndexMetadata + Keyspace string + Kind ColumnKind + 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(host *HostInfo, 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 + ConnectTimeout time.Duration + Keepalive time.Duration + ProtoVersion int + Timeout time.Duration + type ConnErrorHandler interface + HandleError func(conn *Conn, err error, closed bool) + type Consistency uint16 + const All + const Any + const EachQuorum + const LocalOne + const LocalQuorum + const One + const Quorum + const Three + const Two + func ParseConsistency(s string) Consistency + func ParseConsistencyWrapper(s string) (consistency Consistency, err error) + func (c Consistency) String() string + type ErrProtocol struct + type Error struct + Code int + Message string + func (e Error) Error() string + type ExecutableQuery interface + GetRoutingKey func() ([]byte, error) + type HostFilter interface + Accept func(host *HostInfo) bool + func AcceptAllFilter() HostFilter + func DataCentreHostFilter(dataCentre string) HostFilter + func DenyAllFilter() HostFilter + func WhiteListHostFilter(hosts ...string) HostFilter + type HostFilterFunc func(host *HostInfo) bool + func (fn HostFilterFunc) Accept(host *HostInfo) bool + type HostInfo struct + func (h *HostInfo) DataCenter() string + func (h *HostInfo) Equal(host *HostInfo) bool + func (h *HostInfo) HostID() string + func (h *HostInfo) IsUp() bool + func (h *HostInfo) Peer() net.IP + func (h *HostInfo) Port() int + func (h *HostInfo) Rack() string + func (h *HostInfo) State() nodeState + func (h *HostInfo) String() string + func (h *HostInfo) Tokens() []string + func (h *HostInfo) Version() cassVersion + type HostSelectionPolicy interface + Pick func(ExecutableQuery) NextHost + func HostPoolHostPolicy(hp hostpool.HostPool) HostSelectionPolicy + func RoundRobinHostPolicy() HostSelectionPolicy + func TokenAwareHostPolicy(fallback HostSelectionPolicy) HostSelectionPolicy + type HostStateNotifier interface + AddHost func(host *HostInfo) + HostDown func(host *HostInfo) + HostUp func(host *HostInfo) + RemoveHost func(host *HostInfo) + type Iter struct + func (iter *Iter) Close() error + func (iter *Iter) Columns() []ColumnInfo + func (iter *Iter) GetCustomPayload() map[string][]byte + func (iter *Iter) Host() *HostInfo + func (iter *Iter) MapScan(m map[string]interface{}) bool + func (iter *Iter) NumRows() int + func (iter *Iter) PageState() []byte + func (iter *Iter) RowData() (RowData, error) + func (iter *Iter) Scan(dest ...interface{}) bool + func (iter *Iter) Scanner() Scanner + func (iter *Iter) SliceMap() ([]map[string]interface{}, error) + func (iter *Iter) Warnings() []string + func (iter *Iter) WillSwitchPage() bool + 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 NewNativeType(proto byte, typ Type, custom string) NativeType + 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 NextHost func() SelectedHost + 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 PoolConfig struct + HostSelectionPolicy HostSelectionPolicy + 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) NoSkipMetadata() *Query + func (q *Query) PageSize(n int) *Query + func (q *Query) PageState(state []byte) *Query + func (q *Query) Prefetch(p float64) *Query + func (q *Query) Release() + 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 + func (q *Query) WithContext(ctx context.Context) *Query + func (q *Query) WithTimestamp(timestamp int64) *Query + func (q Query) String() string + type QueryInfo struct + Args []ColumnInfo + Id []byte + PKeyColumns []int + 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 RequestErrFunctionFailure struct + ArgTypes []string + Function string + Keyspace string + func (e RequestErrFunctionFailure) Code() int + func (e RequestErrFunctionFailure) Error() string + func (e RequestErrFunctionFailure) Message() string + func (e RequestErrFunctionFailure) String() string + type RequestErrReadFailure struct + BlockFor int + Consistency Consistency + DataPresent bool + NumFailures int + Received int + func (e RequestErrReadFailure) Code() int + func (e RequestErrReadFailure) Error() string + func (e RequestErrReadFailure) Message() string + func (e RequestErrReadFailure) 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 RequestErrWriteFailure struct + BlockFor int + Consistency Consistency + NumFailures int + Received int + WriteType string + func (e RequestErrWriteFailure) Code() int + func (e RequestErrWriteFailure) Error() string + func (e RequestErrWriteFailure) Message() string + func (e RequestErrWriteFailure) 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 Scanner interface + Err func() error + Next func() bool + Scan func(...interface{}) error + type SelectedHost interface + Info func() *HostInfo + Mark func(error) + type SerialConsistency uint16 + const LocalSerial + const Serial + func (s SerialConsistency) String() string + type Session struct + 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) ExecuteBatchCAS(batch *Batch, dest ...interface{}) (applied bool, iter *Iter, err error) + func (s *Session) KeyspaceMetadata(keyspace string) (*KeyspaceMetadata, error) + func (s *Session) MapExecuteBatchCAS(batch *Batch, dest map[string]interface{}) (applied bool, iter *Iter, err 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 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 StdLogger interface + Print func(v ...interface{}) + Printf func(format string, v ...interface{}) + Println func(v ...interface{}) + var Logger StdLogger = &defaultLogger{} + type TableMetadata struct + ClusteringColumns []*ColumnMetadata + ColumnAliases []string + Columns map[string]*ColumnMetadata + Comparator string + DefaultValidator string + KeyAliases []string + KeyValidator string + Keyspace string + Name string + OrderedColumns []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 + func (t TupleTypeInfo) New() interface{} + type Type int + const TypeAscii + const TypeBigInt + const TypeBlob + const TypeBoolean + const TypeCounter + const TypeCustom + const TypeDate + const TypeDecimal + const TypeDouble + const TypeFloat + const TypeInet + const TypeInt + const TypeList + const TypeMap + const TypeSet + const TypeSmallInt + const TypeText + const TypeTime + const TypeTimeUUID + const TypeTimestamp + const TypeTinyInt + const TypeTuple + const TypeUDT + const TypeUUID + const TypeVarchar + const TypeVarint + 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) New() interface{} + 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) UnmarshalText(text []byte) (err error) + func (u UUID) Bytes() []byte + func (u UUID) MarshalJSON() ([]byte, error) + func (u UUID) MarshalText() ([]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