Documentation ¶
Index ¶
- type TestStoragePlugin
- func (s *TestStoragePlugin) Aggregate(ctx context.Context, opts plugins.AggregateOptions) ([]bson.Raw, error)
- func (s *TestStoragePlugin) Close() error
- func (s *TestStoragePlugin) Connect(ctx context.Context) error
- func (s *TestStoragePlugin) Count(ctx context.Context, opts plugins.CountOptions) (int64, error)
- func (s *TestStoragePlugin) EnsureIndex(ctx context.Context, opts plugins.EnsureIndexOptions) error
- func (s *TestStoragePlugin) Find(ctx context.Context, opts plugins.FindOptions) ([]bson.Raw, error)
- func (s *TestStoragePlugin) Insert(ctx context.Context, opts plugins.InsertOptions) error
- func (s *TestStoragePlugin) Patch(ctx context.Context, opts plugins.PatchOptions) error
- func (s *TestStoragePlugin) Remove(ctx context.Context, opts plugins.RemoveOptions) error
- func (s *TestStoragePlugin) Update(ctx context.Context, opts plugins.UpdateOptions) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestStoragePlugin ¶
type TestStoragePlugin struct {
// contains filtered or unexported fields
}
TestStoragePlugin is a test helper that implements a storage plugin backed by a mongodb instance that saves data to a temporary directory.
func NewTestStoragePlugin ¶
func NewTestStoragePlugin(tc *portercontext.TestContext) *TestStoragePlugin
func (*TestStoragePlugin) Aggregate ¶
func (s *TestStoragePlugin) Aggregate(ctx context.Context, opts plugins.AggregateOptions) ([]bson.Raw, error)
func (*TestStoragePlugin) Close ¶
func (s *TestStoragePlugin) Close() error
Close removes the test database and closes the connection.
func (*TestStoragePlugin) Connect ¶
func (s *TestStoragePlugin) Connect(ctx context.Context) error
Connect creates a new database for the current test The plugin itself is responsible for ensuring it was called. Close is called automatically when the plugin is used by Porter.
func (*TestStoragePlugin) Count ¶
func (s *TestStoragePlugin) Count(ctx context.Context, opts plugins.CountOptions) (int64, error)
func (*TestStoragePlugin) EnsureIndex ¶
func (s *TestStoragePlugin) EnsureIndex(ctx context.Context, opts plugins.EnsureIndexOptions) error
func (*TestStoragePlugin) Find ¶
func (s *TestStoragePlugin) Find(ctx context.Context, opts plugins.FindOptions) ([]bson.Raw, error)
func (*TestStoragePlugin) Insert ¶
func (s *TestStoragePlugin) Insert(ctx context.Context, opts plugins.InsertOptions) error
func (*TestStoragePlugin) Patch ¶
func (s *TestStoragePlugin) Patch(ctx context.Context, opts plugins.PatchOptions) error
func (*TestStoragePlugin) Remove ¶
func (s *TestStoragePlugin) Remove(ctx context.Context, opts plugins.RemoveOptions) error
func (*TestStoragePlugin) Update ¶
func (s *TestStoragePlugin) Update(ctx context.Context, opts plugins.UpdateOptions) error
Click to show internal directories.
Click to hide internal directories.