Documentation
¶
Overview ¶
Package firestore provides an in-memory mock implementation of Google Cloud Firestore.
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) CreateTable(_ context.Context, cfg driver.TableConfig) error
- func (m *Mock) DeleteItem(ctx context.Context, table string, key map[string]any) error
- func (m *Mock) DeleteTable(_ context.Context, name string) 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(ctx 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) ListTables(_ context.Context) ([]string, error)
- func (m *Mock) PutItem(ctx context.Context, table string, item map[string]any) error
- func (m *Mock) Query(ctx context.Context, input driver.QueryInput) (*driver.QueryResult, error)
- func (m *Mock) Scan(ctx context.Context, input driver.ScanInput) (*driver.QueryResult, error)
- func (m *Mock) SetMonitoring(mon mondriver.Monitoring)
- func (m *Mock) TransactWriteItems(_ context.Context, table string, puts []map[string]any, ...) error
- func (m *Mock) UpdateItem(ctx 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 ¶
View Source
const ( OpEqual = "=" OpNotEqual = "!=" OpLessThan = "<" OpGreaterThan = ">" OpLessEqual = "<=" OpGreaterEqual = ">=" OpContains = "CONTAINS" OpBeginsWith = "BEGINS_WITH" OpBetween = "BETWEEN" )
Scan/query filter operator constants.
View Source
const ( ViewNewImage = "NEW_IMAGE" ViewOldImage = "OLD_IMAGE" ViewNewAndOld = "NEW_AND_OLD_IMAGES" ViewKeysOnly = "KEYS_ONLY" )
Snapshot and TTL 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 Google Cloud Firestore.
func (*Mock) BatchGetItems ¶
func (*Mock) BatchPutItems ¶
func (*Mock) CreateTable ¶
func (*Mock) DeleteItem ¶
func (*Mock) DescribeTTL ¶ added in v1.2.0
DescribeTTL returns the TTL configuration for a collection.
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 snapshot records after the given token.
func (*Mock) Query ¶
func (m *Mock) Query(ctx 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) 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) UpdateItem ¶ added in v1.3.1
func (m *Mock) UpdateItem(ctx context.Context, input driver.UpdateItemInput) (map[string]any, error)
UpdateItem applies partial updates to an existing document in a collection.
func (*Mock) UpdateStreamConfig ¶ added in v1.2.0
UpdateStreamConfig configures real-time listeners for a collection.
Click to show internal directories.
Click to hide internal directories.