mock

package
v0.0.0-...-634de83 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Name string
	Data []interface{}
}

type Database

type Database struct {
	Name        string
	Collections map[string]*Collection
	// contains filtered or unexported fields
}

func NewDatabase

func NewDatabase(name string, config *MockConfig) *Database

func (*Database) CreateCollection

func (db *Database) CreateCollection(name string) (*Collection, error)

func (*Database) DeleteCollection

func (db *Database) DeleteCollection(name string) error

func (*Database) GetCollection

func (db *Database) GetCollection(name string) (*Collection, error)

type Document

type Document map[string]interface{}

type MockConfig

type MockConfig struct {
	SimulateLatency bool
	LatencyMs       int
	ErrorMode       bool
}

type MockDocDB

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

func NewMockDocDB

func NewMockDocDB(config *MockConfig) *MockDocDB

func (*MockDocDB) CountDocuments

func (m *MockDocDB) CountDocuments(collection string, filter interface{}) (int, error)

func (*MockDocDB) CreateCluster

func (*MockDocDB) CreateInstance

func (*MockDocDB) DeleteCluster

func (*MockDocDB) DeleteDocument

func (m *MockDocDB) DeleteDocument(collection string, filter interface{}) error

func (*MockDocDB) DeleteInstance

func (*MockDocDB) DeleteMany

func (m *MockDocDB) DeleteMany(collection string, filter Document) (int, error)

func (*MockDocDB) FindDocument

func (m *MockDocDB) FindDocument(collection string, filter Document) ([]Document, error)

func (*MockDocDB) InsertDocument

func (m *MockDocDB) InsertDocument(collection string, document Document) error

func (*MockDocDB) InsertMany

func (m *MockDocDB) InsertMany(collection string, documents []interface{}) error

func (*MockDocDB) UpdateMany

func (m *MockDocDB) UpdateMany(collection string, filter, update interface{}) error

func (*MockDocDB) UpdateOne

func (m *MockDocDB) UpdateOne(collection string, filter, update interface{}) error

type MockSecretsManager

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

func NewMockSecretsManager

func NewMockSecretsManager() *MockSecretsManager

func (*MockSecretsManager) AddSecret

func (m *MockSecretsManager) AddSecret(secretID, secretValue string)

func (*MockSecretsManager) GetSecretValue

type SecretsManagerClient

type SecretsManagerClient interface {
	GetSecretValue(input *secretsmanager.GetSecretValueInput) (*secretsmanager.GetSecretValueOutput, error)
}

Jump to

Keyboard shortcuts

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