Documentation
¶
Index ¶
- Constants
- type Mock
- func (m *Mock) BatchGetItems(_ context.Context, table string, keys []map[string]any) ([]map[string]any, error)
- func (m *Mock) BatchPutItems(_ context.Context, table string, items []map[string]any) error
- func (m *Mock) CreateIndex(_ context.Context, table string, cfg driver.GSIConfig) (*driver.IndexInfo, error)
- func (m *Mock) CreateTable(_ context.Context, cfg driver.TableConfig) error
- func (m *Mock) DeleteIndex(_ context.Context, table, indexName string) error
- func (m *Mock) DeleteItem(_ context.Context, table string, key map[string]any) error
- func (m *Mock) DeleteTable(_ context.Context, name string) error
- func (m *Mock) DescribeIndex(_ context.Context, table, indexName string) (*driver.IndexInfo, error)
- func (m *Mock) DescribeTTL(_ context.Context, table string) (*driver.TTLConfig, error)
- func (m *Mock) DescribeTable(_ context.Context, name string) (*driver.TableConfig, error)
- func (m *Mock) GetItem(_ context.Context, table string, key map[string]any) (map[string]any, error)
- func (m *Mock) GetStreamRecords(_ context.Context, table string, limit int, token string) (*driver.StreamIterator, error)
- func (m *Mock) ListIndexes(_ context.Context, table string) ([]driver.IndexInfo, error)
- func (m *Mock) ListTables(_ context.Context) ([]string, error)
- func (m *Mock) ListTagsOfResource(_ context.Context, table string) (map[string]string, error)
- func (m *Mock) PutItem(_ context.Context, table string, item map[string]any) error
- func (m *Mock) Query(_ context.Context, input driver.QueryInput) (*driver.QueryResult, error)
- func (m *Mock) Scan(_ context.Context, input driver.ScanInput) (*driver.QueryResult, error)
- func (m *Mock) SetMonitoring(mon mondriver.Monitoring)
- func (m *Mock) TagResource(_ context.Context, table string, tags map[string]string) error
- func (m *Mock) TransactWriteItems(_ context.Context, table string, puts []map[string]any, ...) error
- func (m *Mock) UntagResource(_ context.Context, table string, tagKeys []string) error
- func (m *Mock) UpdateItem(_ context.Context, input driver.UpdateItemInput) (map[string]any, error)
- func (m *Mock) UpdateStreamConfig(_ context.Context, table string, cfg driver.StreamConfig) error
- func (m *Mock) UpdateTTL(_ context.Context, table string, cfg driver.TTLConfig) error
Constants ¶
const ( OpEqual = "=" OpNotEqual = "!=" OpLessThan = "<" OpGreaterThan = ">" OpLessEqual = "<=" OpGreaterEqual = ">=" OpContains = "CONTAINS" OpBeginsWith = "BEGINS_WITH" OpBetween = "BETWEEN" )
Scan/query filter operator constants.
const ( ViewNewImage = "NEW_IMAGE" ViewOldImage = "OLD_IMAGE" ViewNewAndOld = "NEW_AND_OLD_IMAGES" ViewKeysOnly = "KEYS_ONLY" )
Stream view type constants.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
Mock is an in-memory mock implementation of DynamoDB.
func (*Mock) BatchGetItems ¶
func (*Mock) BatchPutItems ¶
func (*Mock) CreateIndex ¶ added in v1.4.0
func (m *Mock) CreateIndex(_ context.Context, table string, cfg driver.GSIConfig) (*driver.IndexInfo, error)
CreateIndex creates a Global Secondary Index on a table.
func (*Mock) CreateTable ¶
func (*Mock) DeleteIndex ¶ added in v1.4.0
DeleteIndex removes a Global Secondary Index from a table.
func (*Mock) DeleteItem ¶
func (*Mock) DescribeIndex ¶ added in v1.4.0
DescribeIndex returns information about a Global Secondary Index.
func (*Mock) DescribeTTL ¶ added in v1.2.0
DescribeTTL returns the TTL configuration for a table.
func (*Mock) DescribeTable ¶
func (*Mock) GetStreamRecords ¶ added in v1.2.0
func (m *Mock) GetStreamRecords( _ context.Context, table string, limit int, token string, ) (*driver.StreamIterator, error)
GetStreamRecords returns stream records after the given token.
func (*Mock) ListIndexes ¶ added in v1.4.0
ListIndexes returns all Global Secondary Indexes for a table.
func (*Mock) ListTagsOfResource ¶ added in v1.6.4
ListTagsOfResource returns a copy of the tag map for a table.
func (*Mock) Query ¶
func (m *Mock) Query(_ context.Context, input driver.QueryInput) (*driver.QueryResult, error)
func (*Mock) SetMonitoring ¶ added in v1.2.0
func (m *Mock) SetMonitoring(mon mondriver.Monitoring)
SetMonitoring sets the monitoring backend for auto-metric generation.
func (*Mock) TagResource ¶ added in v1.6.4
TagResource sets or replaces tag key/values on a table. Existing keys not present in tags are preserved; existing keys present in tags are overwritten.
func (*Mock) TransactWriteItems ¶ added in v1.2.0
func (m *Mock) TransactWriteItems( _ context.Context, table string, puts []map[string]any, deletes []map[string]any, ) error
TransactWriteItems executes puts and deletes atomically.
func (*Mock) UntagResource ¶ added in v1.6.4
UntagResource removes the given tag keys from a table. Unknown keys are ignored.
func (*Mock) UpdateItem ¶ added in v1.3.1
UpdateItem applies partial updates to an existing item.
func (*Mock) UpdateStreamConfig ¶ added in v1.2.0
UpdateStreamConfig configures streams for a table.