mongodb

package
v1.0.0-alpha.16 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const PluginKey = plugins.PluginInterface + ".porter.mongodb"

Variables

View Source
var (
	ErrNotConnected = errors.New("cannot execute command against the mongodb plugin because the session is closed (or was never connected)")
)

Functions

func NewPlugin

func NewPlugin(cxt *portercontext.Context, pluginConfig interface{}) (plugins.StoragePlugin, error)

Types

type PluginConfig

type PluginConfig struct {
	URL     string `mapstructure:"url"`
	Timeout int    `mapstructure:"timeout,omitempty"`
}

PluginConfig are the configuration settings that can be defined for the mongodb plugin in porter.yaml

type Store

type Store struct {
	*portercontext.Context
	// contains filtered or unexported fields
}

Store implements the Porter plugin.StoragePlugin interface for mongodb.

func NewStore

func NewStore(c *portercontext.Context, cfg PluginConfig) *Store

NewStore creates a new storage engine that uses MongoDB.

func (*Store) Aggregate

func (s *Store) Aggregate(opts plugins.AggregateOptions) ([]bson.Raw, error)

func (*Store) Close

func (s *Store) Close() error

func (*Store) Connect

func (s *Store) Connect() error

func (*Store) Count

func (s *Store) Count(opts plugins.CountOptions) (int64, error)

func (*Store) EnsureIndex

func (s *Store) EnsureIndex(opts plugins.EnsureIndexOptions) error

EnsureIndexes makes sure that the specified indexes exist and are defined appropriately.

func (*Store) Find

func (s *Store) Find(opts plugins.FindOptions) ([]bson.Raw, error)

func (*Store) Insert

func (s *Store) Insert(opts plugins.InsertOptions) error

func (*Store) Patch

func (s *Store) Patch(opts plugins.PatchOptions) error

func (*Store) Ping

func (s *Store) Ping() error

Ping the connected session to check if everything is okay.

func (*Store) Remove

func (s *Store) Remove(opts plugins.RemoveOptions) error

func (*Store) RemoveDatabase

func (s *Store) RemoveDatabase() error

RemoveDatabase removes the current database.

func (*Store) Update

func (s *Store) Update(opts plugins.UpdateOptions) error

Jump to

Keyboard shortcuts

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