mongobin

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EtcOsRelease = "/etc/os-release"

We define these as package vars so we can override it in tests

View Source
var EtcRedhatRelease = "/etc/redhat-release"
View Source
var GoArch = runtime.GOARCH
View Source
var GoOS = runtime.GOOS

Functions

func GetOrDownloadMongod

func GetOrDownloadMongod(urlStr string, cachePath string, logger *memongolog.Logger) (string, error)

GetOrDownloadMongod returns the path to the mongod binary from the tarball at the given URL. If the URL has not yet been downloaded, it's downloaded and saved the the cache. If it has been downloaded, the existing mongod path is returned.

Types

type DownloadSpec

type DownloadSpec struct {
	// Version is what version of MongoDB to download
	Version string

	// Platform is "osx" or "linux"
	Platform string

	// SSLBuildNeeded is "ssl" if we need to download the SSL build for macOS
	// (needed for <4.2)
	SSLBuildNeeded bool

	// Arch is always "x86_64"
	Arch string

	ParsedVersion []int

	// OSName is one of:
	// - ubuntu2204
	// - ubuntu2004
	// - ubuntu1804
	// - ubuntu1604
	// - ubuntu1404
	// - debian10
	// - debian92
	// - debian81
	// - suse12
	// - rhel70
	// - rhel80
	// - rhel62
	// - amazon
	// - amazon2
	// - "" for other linux or for MacOS
	OSName string
}

DownloadSpec specifies what copy of MongoDB to download

func MakeDownloadSpec

func MakeDownloadSpec(version string) (*DownloadSpec, error)

MakeDownloadSpec returns a DownloadSpec for the current operating system

func (*DownloadSpec) GetDownloadURL

func (spec *DownloadSpec) GetDownloadURL() string

GetDownloadURL returns the download URL to download the binary from the MongoDB website

type UnsupportedMongoVersionError

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

UnsupportedMongoVersionError is used to indicate the memongo doesn't know how to download the given version of MongoDB

func (*UnsupportedMongoVersionError) Error

func (err *UnsupportedMongoVersionError) Error() string

type UnsupportedSystemError

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

UnsupportedSystemError is used to indicate that memongo does not support automatic selection of the right MongoDB binary for your system

func (*UnsupportedSystemError) Error

func (err *UnsupportedSystemError) Error() string

Directories

Path Synopsis
Package mock_afero is a generated GoMock package.
Package mock_afero is a generated GoMock package.

Jump to

Keyboard shortcuts

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