cql

package
v0.0.43 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfig = Config{
		Concurrency:           5,
		Timeout:               600 * time.Millisecond,
		ConnectTimeout:        600 * time.Millisecond,
		Retries:               100,
		RetryMinBackOff:       100 * time.Millisecond,
		RetryMaxBackOff:       time.Second,
		ReconnectInterval:     10 * time.Second,
		Consistency:           gocql.LocalQuorum,
		SerialConsistency:     gocql.LocalSerial,
		ReplicationClass:      "SimpleStrategy",
		ReplicationFactor:     1,
		CqlVersion:            "3.4.4",
		DefaultIdempotence:    true,
		QueryObserver:         nil,
		PageSize:              1000,
		WriteCoalesceWaitTime: time.Millisecond,
	}
)

Functions

func AddCqlQuery

func AddCqlQuery(q string)

func Exec

func Exec(q *gocqlx.Queryx) error

func Get

func Get(q *gocqlx.Queryx, dest interface{}) error

func Init

func Init(config Config) (err error)

func MustInit

func MustInit(config Config)

func New

func New(config Config) (gocqlx.Session, error)

func NewQueryFactory

func NewQueryFactory(genFunc queryBuilderFunc) *queryFactory

NewQueryFactory creates a query pool for cql queries

func RunCqlQueries

func RunCqlQueries() error

func Scan

func Scan(q *gocqlx.Queryx, dest ...interface{}) error

func Select

func Select(q *gocqlx.Queryx, dest interface{}) error

func Session

func Session() gocqlx.Session

func SetSpeculativeAttempts

func SetSpeculativeAttempts(attempts int)

func SetSpeculativeDelay

func SetSpeculativeDelay(delay time.Duration)

Types

type Config

type Config struct {
	Host                  string
	Username              string
	Password              string
	Keyspace              string
	Retries               int
	RetryMinBackOff       time.Duration
	RetryMaxBackOff       time.Duration
	ConnectTimeout        time.Duration
	Timeout               time.Duration
	ReconnectInterval     time.Duration
	Concurrency           int
	Consistency           gocql.Consistency
	SerialConsistency     gocql.SerialConsistency
	ReplicationClass      string
	ReplicationFactor     int
	CqlVersion            string
	DefaultIdempotence    bool
	QueryObserver         gocql.QueryObserver
	PageSize              int
	WriteCoalesceWaitTime time.Duration
}

Jump to

Keyboard shortcuts

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