Documentation ¶
Index ¶
- Constants
- Variables
- func ConnectionPool(ks string) (gossie.ConnectionPool, error)
- func HealthCheck(keyspace string, cfs []string) healthcheck.Checker
- func MaxConnHealthCheck(maxconns int) healthcheck.Checker
- func NewMockConnectionPool(nodes []string, keyspace string, options gossie.PoolOptions) (gossie.ConnectionPool, error)
- type MockConnectionPool
- func (cp *MockConnectionPool) Batch() gossie.Batch
- func (cp *MockConnectionPool) Close() error
- func (cp *MockConnectionPool) Keyspace() string
- func (cp *MockConnectionPool) Query(gossie.Mapping) gossie.Query
- func (cp *MockConnectionPool) Reader() gossie.Reader
- func (cp *MockConnectionPool) Schema() *gossie.Schema
- func (cp *MockConnectionPool) Writer() gossie.Writer
- type MockQuery
- type MockReader
- func (r *MockReader) Cf(cf string) gossie.Reader
- func (r *MockReader) Columns(columns [][]byte) gossie.Reader
- func (r *MockReader) ConsistencyLevel(level int) gossie.Reader
- func (r *MockReader) Count(key []byte) (int, error)
- func (r *MockReader) Get(key []byte) (*gossie.Row, error)
- func (r *MockReader) IndexedGet(rang *gossie.IndexedRange) ([]*gossie.Row, error)
- func (r *MockReader) MultiCount(keys [][]byte) ([]*gossie.RowColumnCount, error)
- func (r *MockReader) MultiGet(keys [][]byte) ([]*gossie.Row, error)
- func (r *MockReader) RangeGet(rang *gossie.Range) ([]*gossie.Row, error)
- func (r *MockReader) Slice(slice *gossie.Slice) gossie.Reader
- func (r *MockReader) Where(column []byte, op gossie.Operator, value []byte) gossie.Reader
- type MockWriter
- func (w *MockWriter) ConsistencyLevel(level int) gossie.Writer
- func (w *MockWriter) Delete(cf string, key []byte) gossie.Writer
- func (w *MockWriter) DeleteColumns(cf string, key []byte, columns [][]byte) gossie.Writer
- func (w *MockWriter) DeltaCounters(cf string, row *gossie.Row) gossie.Writer
- func (w *MockWriter) Insert(cf string, row *gossie.Row) gossie.Writer
- func (w *MockWriter) InsertTtl(cf string, row *gossie.Row, ttl int) gossie.Writer
- func (w *MockWriter) Run() error
- type MultiRowProvider
- type SingleRowProvider
Constants ¶
View Source
const ( HealthCheckId = "com.hailocab.service.cassandra" MaxConnCheckId = "com.hailocab.service.cassandra.maxconns" )
Variables ¶
View Source
var ( DefaultPoolConstructor func([]string, string, gossie.PoolOptions) (gossie.ConnectionPool, error) = gossie.NewConnectionPool // Pointer to the underlying ConnectionPool constructor to use (used to switch out the pool implementation when // mocking) PoolConstructor func([]string, string, gossie.PoolOptions) (gossie.ConnectionPool, error) = DefaultPoolConstructor )
Functions ¶
func ConnectionPool ¶
func ConnectionPool(ks string) (gossie.ConnectionPool, error)
ConnectionPool yields a configured connection pool for the given keyspace This should be called on each use, as this will mean that you will always get an up-to-date connection pool (automatically updated if the config changes)
func HealthCheck ¶
func HealthCheck(keyspace string, cfs []string) healthcheck.Checker
HealthCheck asserts we can connect to C* and
func MaxConnHealthCheck ¶
func MaxConnHealthCheck(maxconns int) healthcheck.Checker
MaxConnHealthCheck asserts that the total number of established connections to all cassandra nodes falls below a given max threshold.
func NewMockConnectionPool ¶
func NewMockConnectionPool(nodes []string, keyspace string, options gossie.PoolOptions) (gossie.ConnectionPool, error)
Types ¶
type MockConnectionPool ¶
func (*MockConnectionPool) Batch ¶
func (cp *MockConnectionPool) Batch() gossie.Batch
func (*MockConnectionPool) Close ¶
func (cp *MockConnectionPool) Close() error
func (*MockConnectionPool) Keyspace ¶
func (cp *MockConnectionPool) Keyspace() string
func (*MockConnectionPool) Reader ¶
func (cp *MockConnectionPool) Reader() gossie.Reader
func (*MockConnectionPool) Schema ¶
func (cp *MockConnectionPool) Schema() *gossie.Schema
func (*MockConnectionPool) Writer ¶
func (cp *MockConnectionPool) Writer() gossie.Writer
type MockReader ¶
func (*MockReader) ConsistencyLevel ¶
func (r *MockReader) ConsistencyLevel(level int) gossie.Reader
func (*MockReader) IndexedGet ¶
func (r *MockReader) IndexedGet(rang *gossie.IndexedRange) ([]*gossie.Row, error)
func (*MockReader) MultiCount ¶
func (r *MockReader) MultiCount(keys [][]byte) ([]*gossie.RowColumnCount, error)
type MockWriter ¶
func (*MockWriter) ConsistencyLevel ¶
func (w *MockWriter) ConsistencyLevel(level int) gossie.Writer
func (*MockWriter) DeleteColumns ¶
func (*MockWriter) DeltaCounters ¶
func (*MockWriter) Run ¶
func (w *MockWriter) Run() error
type MultiRowProvider ¶
type MultiRowProvider struct { // mapping for unmarshaling a row into a struct Mapping gossie.Mapping // our buffer of rows Buffer []*gossie.Row // how many columns to limit to ColumnLimit int // contains filtered or unexported fields }
func (*MultiRowProvider) Key ¶
func (r *MultiRowProvider) Key() ([]byte, error)
func (*MultiRowProvider) Next ¶
func (r *MultiRowProvider) Next(destination interface{}) error
func (*MultiRowProvider) NextColumn ¶
func (r *MultiRowProvider) NextColumn() (*gossie.Column, error)
func (*MultiRowProvider) Rewind ¶
func (r *MultiRowProvider) Rewind()
type SingleRowProvider ¶
func (*SingleRowProvider) Key ¶
func (r *SingleRowProvider) Key() ([]byte, error)
func (*SingleRowProvider) NextColumn ¶
func (r *SingleRowProvider) NextColumn() (*gossie.Column, error)
func (*SingleRowProvider) Rewind ¶
func (r *SingleRowProvider) Rewind()
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Offers up a recipe built on Gossie to make dealing with time indexes simple.
|
Offers up a recipe built on Gossie to make dealing with time indexes simple. |
Click to show internal directories.
Click to hide internal directories.