binurl

package
v0.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MongodbArchiveURL      = "https://www.mongodb.com/download-center/community/releases/archive"
	NotSpaceNorHyphenRegex = `[^ \t\r\n\f-]*`
	// TagProtoRegexp capture group comments:
	// #0: Tag
	// #1: OS
	// #2: Arch
	// #3: reserved
	// #4: Distributive (if any)
	// #5: Version
	TagProtoRegexp = `mongodb-(%s)-(%s)(-(%s))?-(%s)`
	// HTMLAProtoRegexp capture group comments:
	// #0: HTML <a> tag
	// #1: URL
	// #2: Tag
	// #3: OS
	// #4: Arch
	// #5: reserved
	// #6: Distributive (if any)
	// #7: Version
	HTMLAProtoRegexp = `<a href="(https:\/\/fastdl\.mongodb\.org\/\S+\.tgz)">(` + TagProtoRegexp + `\.tgz)<\/a>`
	// URLProtoRegexp capture group comments:
	// #0: URL
	// #1: Tag
	// #2: OS
	// #3: Arch
	// #4: reserved
	// #5: Distributive (if any)
	// #6: Version
	URLProtoRegexp = `https:\/\/fastdl\.mongodb\.org\/\S+\/(` + TagProtoRegexp + `)\.tgz`
)

Variables

View Source
var (
	TagRegexp   = buildRegexp(TagProtoRegexp)
	HTMLARegexp = buildRegexp(HTMLAProtoRegexp)
	URLRegexp   = buildRegexp(URLProtoRegexp)
)

Functions

This section is empty.

Types

type Arch

type Arch string
var (
	ArchUnspecified Arch = ""
	ArchAMD64       Arch = "x86_64"
	ArchARM64       Arch = "arm64"
	ArchAArch64     Arch = "aarch64"

	Archs = []Arch{
		ArchAMD64,
		ArchARM64,
		ArchAArch64,
	}
)

func ToArch

func ToArch(arch string) Arch
type BinaryLinks struct {
	URL          string
	Tag          string
	Arch         Arch
	OS           OperationSystem
	Distributive string
	Version      semver.Version
}

BinaryLinks represent MongoDB binary distribution.

func MakeBinaryLinkByHTMLA

func MakeBinaryLinkByHTMLA(HTMLA string) *BinaryLinks

func MakeBinaryLinkByTag

func MakeBinaryLinkByTag(Tag string) *BinaryLinks

func MakeBinaryLinkByURL

func MakeBinaryLinkByURL(URL string) *BinaryLinks

func TakeMaxDistrVersion

func TakeMaxDistrVersion(links []BinaryLinks) ([]BinaryLinks, error)

TakeMaxDistrVersion method is useful when you wish to find the most modern distribution (e.g. ubuntu1804 vs ubuntu2004)

func TakeMaxPatchVersion

func TakeMaxPatchVersion(links []BinaryLinks) ([]BinaryLinks, error)

TakeMaxPatchVersion method is useful when you wish to find the most modern patch

type OperationSystem

type OperationSystem string
var (
	OperationSystemUnspecified OperationSystem = ""
	OperationSystemMacos       OperationSystem = "macos"
	OperationSystemOsx         OperationSystem = "osx"
	OperationSystemOsxSsl      OperationSystem = "osx-ssl"
	OperationSystemLinux       OperationSystem = "linux"

	OperationSystems = []OperationSystem{
		OperationSystemMacos,
		OperationSystemOsx,
		OperationSystemOsxSsl,
		OperationSystemLinux,
	}
)

func ToOs

func ToOs(os string) OperationSystem

Jump to

Keyboard shortcuts

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