Documentation ¶
Overview ¶
Package mongodb_docker implements the plugins.StorageProtocol interface, storing data using an instance of mongodb running in a container, with the data stored in a docker volume.
Index ¶
- Constants
- func EnsureMongoIsRunning(ctx context.Context, c *portercontext.Context, container string, port string, ...) (*mongodb.Store, error)
- func NewPlugin(c *portercontext.Context, rawCfg interface{}) (plugin.Plugin, error)
- 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) Remove(ctx context.Context, opts plugins.RemoveOptions) error
- func (s *Store) Update(ctx context.Context, opts plugins.UpdateOptions) error
Constants ¶
const PluginKey = plugins.PluginInterface + ".porter.mongodb-docker"
PluginKey is the identifier of the internal mongodb run in docker plugin.
Variables ¶
This section is empty.
Functions ¶
func EnsureMongoIsRunning ¶
func NewPlugin ¶
func NewPlugin(c *portercontext.Context, rawCfg interface{}) (plugin.Plugin, error)
NewPlugin creates an instance of the storage.porter.mongodb-docker plugin
Types ¶
type PluginConfig ¶
type PluginConfig struct { Port string `mapstructure:"port,omitempty"` Database string `mapstructure:"database,omitempty"` // Timeout in seconds Timeout int `mapstructure:"timeout,omitempty"` }
PluginConfig supported by the mongodb-docker plugin as defined in porter.yaml
type Store ¶
Store is a storage plugin for porter suitable for running on machines that have not configured proper storage, i.e. a mongo database. It runs mongodb in a docker container and stores its data in a docker volume.
func NewStore ¶
func NewStore(c *portercontext.Context, cfg PluginConfig) *Store
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 ¶
EnsureIndex makes sure that the specified index exists as specified. If it does exist with a different definition, the index is recreated.