cassandra

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fixtures

func Fixtures() ([]testutils.Fixture, error)

Fixtures for unit testing Cassandra integration.

func NewTableClient

func NewTableClient(ctx context.Context, cfg Config) (chunk.TableClient, error)

NewTableClient returns a new TableClient.

Types

type Config

type Config struct {
	Addresses                string              `yaml:"addresses"`
	Port                     int                 `yaml:"port"`
	Keyspace                 string              `yaml:"keyspace"`
	Consistency              string              `yaml:"consistency"`
	ReplicationFactor        int                 `yaml:"replication_factor"`
	DisableInitialHostLookup bool                `yaml:"disable_initial_host_lookup"`
	SSL                      bool                `yaml:"SSL"`
	HostVerification         bool                `yaml:"host_verification"`
	CAPath                   string              `yaml:"CA_path"`
	Auth                     bool                `yaml:"auth"`
	Username                 string              `yaml:"username"`
	Password                 flagext.Secret      `yaml:"password"`
	PasswordFile             string              `yaml:"password_file"`
	CustomAuthenticators     flagext.StringSlice `yaml:"custom_authenticators"`
	Timeout                  time.Duration       `yaml:"timeout"`
	ConnectTimeout           time.Duration       `yaml:"connect_timeout"`
	Retries                  int                 `yaml:"max_retries"`
	MaxBackoff               time.Duration       `yaml:"retry_max_backoff"`
	MinBackoff               time.Duration       `yaml:"retry_min_backoff"`
	QueryConcurrency         int                 `yaml:"query_concurrency"`
}

Config for a StorageClient

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

func (*Config) Validate added in v0.7.0

func (cfg *Config) Validate() error

type CustomPasswordAuthenticator added in v0.7.0

type CustomPasswordAuthenticator struct {
	ApprovedAuthenticators []string
	Username               string
	Password               string
}

CustomPasswordAuthenticator provides the default behaviour for Username/Password authentication with Cassandra while allowing users to specify a non-default Authenticator to accept.

func (CustomPasswordAuthenticator) Challenge added in v0.7.0

func (p CustomPasswordAuthenticator) Challenge(req []byte) ([]byte, gocql.Authenticator, error)

Challenge verifies the name of the authenticator and formats the provided username and password into a response

func (CustomPasswordAuthenticator) Success added in v0.7.0

func (p CustomPasswordAuthenticator) Success(data []byte) error

Success returns nil by default, identical to the default PasswordAuthenticator

type StorageClient

type StorageClient struct {
	// contains filtered or unexported fields
}

StorageClient implements chunk.IndexClient and chunk.ObjectClient for Cassandra.

func NewStorageClient

func NewStorageClient(cfg Config, schemaCfg chunk.SchemaConfig) (*StorageClient, error)

NewStorageClient returns a new StorageClient.

func (*StorageClient) BatchWrite

func (s *StorageClient) BatchWrite(ctx context.Context, batch chunk.WriteBatch) error

BatchWrite implement chunk.IndexClient.

func (*StorageClient) DeleteChunk added in v0.7.0

func (s *StorageClient) DeleteChunk(ctx context.Context, chunkID string) error

func (*StorageClient) GetChunks

func (s *StorageClient) GetChunks(ctx context.Context, input []chunk.Chunk) ([]chunk.Chunk, error)

GetChunks implements chunk.ObjectClient.

func (*StorageClient) NewWriteBatch

func (s *StorageClient) NewWriteBatch() chunk.WriteBatch

NewWriteBatch implement chunk.IndexClient.

func (*StorageClient) PutChunks

func (s *StorageClient) PutChunks(ctx context.Context, chunks []chunk.Chunk) error

PutChunks implements chunk.ObjectClient.

func (*StorageClient) QueryPages

func (s *StorageClient) QueryPages(ctx context.Context, queries []chunk.IndexQuery, callback func(chunk.IndexQuery, chunk.ReadBatch) bool) error

QueryPages implement chunk.IndexClient.

func (*StorageClient) Stop

func (s *StorageClient) Stop()

Stop implement chunk.IndexClient.

Jump to

Keyboard shortcuts

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