Documentation ¶
Index ¶
- Constants
- Variables
- func NewPlugin(cxt *context.Context, pluginConfig interface{}) (plugins.StoragePlugin, error)
- type PluginConfig
- type Store
- func (s *Store) Aggregate(opts plugins.AggregateOptions) ([]bson.Raw, error)
- func (s *Store) Close() error
- func (s *Store) Connect() error
- func (s *Store) Count(opts plugins.CountOptions) (int64, error)
- func (s *Store) EnsureIndex(opts plugins.EnsureIndexOptions) error
- func (s *Store) Find(opts plugins.FindOptions) ([]bson.Raw, error)
- func (s *Store) Insert(opts plugins.InsertOptions) error
- func (s *Store) Patch(opts plugins.PatchOptions) error
- func (s *Store) Ping() error
- func (s *Store) Remove(opts plugins.RemoveOptions) error
- func (s *Store) RemoveDatabase() error
- func (s *Store) Update(opts plugins.UpdateOptions) error
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 ¶
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) EnsureIndex ¶
func (s *Store) EnsureIndex(opts plugins.EnsureIndexOptions) error
EnsureIndexes makes sure that the specified indexes exist and are defined appropriately.
func (*Store) RemoveDatabase ¶
RemoveDatabase removes the current database.
Click to show internal directories.
Click to hide internal directories.