mongo

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DriverName = "mongodb"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MongoMigrationsEnabled    bool   `envconfig:"MONGO_MIGRATIONS_ENABLED" default:"false"`
	MongoHost                 string `envconfig:"MONGO_HOST"`
	MongoPort                 string `envconfig:"MONGO_PORT"`
	MongoLogin                string `envconfig:"MONGO_LOGIN"`
	MongoPassword             string `envconfig:"MONGO_PASSWORD"`
	MongoDatabase             string `envconfig:"MONGO_DATABASE"`
	MongoMigrationsCollection string `envconfig:"MONGO_MIGRATIONS_COLLECTION" default:"migrationVersions"`
}

func Load

func Load() (*Config, error)

func (*Config) GetMongoDatabase

func (c *Config) GetMongoDatabase() string

func (*Config) GetMongoHost

func (c *Config) GetMongoHost() string

func (*Config) GetMongoLogin

func (c *Config) GetMongoLogin() string

func (*Config) GetMongoMigrationsCollection

func (c *Config) GetMongoMigrationsCollection() string

func (*Config) GetMongoPassword

func (c *Config) GetMongoPassword() string

func (*Config) GetMongoPort

func (c *Config) GetMongoPort() string

func (*Config) IsMongoMigrationsEnabled

func (c *Config) IsMongoMigrationsEnabled() bool

type Configurator

type Configurator interface {
	GetMongoHost() string
	GetMongoPort() string
	GetMongoLogin() string
	GetMongoPassword() string
	GetMongoDatabase() string
	GetMongoMigrationsCollection() string
	IsMongoMigrationsEnabled() bool
}

type Mongo

type Mongo struct {
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, cfg Configurator, fs embed.FS) (*Mongo, error)

func (*Mongo) Down

func (m *Mongo) Down() error

func (*Mongo) Name

func (m *Mongo) Name() string

func (*Mongo) Up

func (m *Mongo) Up() error

Jump to

Keyboard shortcuts

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