cassandra

package
v11.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOptions

type ClientOptions func(*ClientOptionsParams)

ClientOptions allows setting test client options.

func WithCassandraUsername

func WithCassandraUsername(username string) ClientOptions

WithCassandraUsername set the username used during cassandra login.

type ClientOptionsParams

type ClientOptionsParams struct {
	Username string
}

ClientOptionsParams is a struct for client configuration options.

type Engine

type Engine struct {
	// EngineConfig is the common database engine configuration.
	common.EngineConfig
	// contains filtered or unexported fields
}

Engine implements common.Engine.

func (*Engine) HandleConnection

func (e *Engine) HandleConnection(ctx context.Context, sessionCtx *common.Session) error

HandleConnection processes the connection from Cassandra proxy coming over reverse tunnel.

func (*Engine) InitializeConnection

func (e *Engine) InitializeConnection(clientConn net.Conn, sessionCtx *common.Session) error

InitializeConnection initializes the database connection.

func (*Engine) SendError

func (e *Engine) SendError(sErr error)

SendError send a Cassandra ServerError to error to the client if handshake was not yet initialized by the client. Cassandra wire protocol relies on streamID to that are set by the client and server response needs to set the correct streamID in order to get streamID SendError reads a first message send by the client.

type Session

type Session = gocql.Session

Session alias for easier use.

func MakeTestClient

func MakeTestClient(_ context.Context, config common.TestClientConfig, opts ...ClientOptions) (*Session, error)

MakeTestClient returns Cassandra client connection according to the provided parameters.

type TestServer

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

func NewTestServer

func NewTestServer(config common.TestServerConfig, opts ...TestServerOption) (*TestServer, error)

NewTestServer returns a new instance of a test Snowflake server.

func (*TestServer) Close

func (s *TestServer) Close() error

Close closes the server.

func (*TestServer) Port

func (s *TestServer) Port() string

func (*TestServer) Serve

func (s *TestServer) Serve() error

Serve starts serving client connections.

type TestServerOption

type TestServerOption func(*TestServer)

TestServerOption allows setting test server options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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