mongodb_docker

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: 10 Imported by: 0

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

View Source
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 EnsureMongoIsRunning(c *portercontext.Context, container string, port string, dataVol string, dbName string, timeoutSeconds int) (*mongodb.Store, error)

func NewPlugin

func NewPlugin(cxt *portercontext.Context, pluginConfig interface{}) (plugins.StoragePlugin, 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

type Store struct {
	plugins.StorageProtocol
	// contains filtered or unexported fields
}

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(cxt *portercontext.Context, cfg PluginConfig) *Store

func (*Store) Close

func (s *Store) Close() error

func (*Store) Connect

func (s *Store) Connect() error

Jump to

Keyboard shortcuts

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