Documentation ¶
Index ¶
- Constants
- Variables
- func NewPlugin(c *portercontext.Context, rawCfg interface{}) (plugin.Plugin, error)
- type Plugin
- type PluginConfig
- type Store
- func (s *Store) Aggregate(ctx context.Context, opts plugins.AggregateOptions) ([]bson.Raw, error)
- func (s *Store) Close() error
- func (s *Store) Connect(ctx context.Context) error
- func (s *Store) Count(ctx context.Context, opts plugins.CountOptions) (int64, error)
- func (s *Store) EnsureIndex(ctx context.Context, opts plugins.EnsureIndexOptions) error
- func (s *Store) Find(ctx context.Context, opts plugins.FindOptions) ([]bson.Raw, error)
- func (s *Store) Insert(ctx context.Context, opts plugins.InsertOptions) error
- func (s *Store) Patch(ctx context.Context, opts plugins.PatchOptions) error
- func (s *Store) Ping(ctx context.Context) error
- func (s *Store) Remove(ctx context.Context, opts plugins.RemoveOptions) error
- func (s *Store) RemoveDatabase(ctx context.Context) error
- func (s *Store) Update(ctx context.Context, 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 ¶
func NewPlugin ¶
func NewPlugin(c *portercontext.Context, rawCfg interface{}) (plugin.Plugin, 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) Connect ¶
Connect initializes the plugin for use. The plugin itself is responsible for ensuring it was called. Close is called automatically when the plugin is used by Porter.
func (*Store) EnsureIndex ¶
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.