dynamodb

package
v0.0.0-...-5c79d48 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEngine

func NewEngine(ec common.EngineConfig) common.Engine

NewEngine create new DynamoDB engine.

Types

type Client

type Client = dynamodb.DynamoDB

Client alias for easier use.

func MakeTestClient

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

MakeTestClient returns DynamoDB client connection according to the provided parameters.

type ClientOptions

type ClientOptions func(*ClientOptionsParams)

ClientOptions allows setting test client options.

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

	// RoundTrippers is a cache of RoundTrippers, mapped by service endpoint.
	// It is not guarded by a mutex, since requests are processed serially.
	RoundTrippers map[string]http.RoundTripper
	// CredentialsGetter is used to obtain STS credentials.
	CredentialsGetter libaws.CredentialsGetter
	// contains filtered or unexported fields
}

Engine handles connections from DynamoDB clients coming from Teleport proxy over reverse tunnel.

func (*Engine) HandleConnection

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

HandleConnection authorizes the incoming client connection, connects to the target DynamoDB server and starts proxying requests between client/server.

func (*Engine) InitializeConnection

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

func (*Engine) SendError

func (e *Engine) SendError(err error)

SendError sends an error to DynamoDB client.

type TestServer

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

TestServer is a DynamoDB test server that mocks AWS signature checking and API.

func NewTestServer

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

NewTestServer returns a new instance of a test DynamoDB 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.

Jump to

Keyboard shortcuts

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