source

package
v0.1.698 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package source chooses where magpie reads from, with a mirror as a fallback when the official address can't be reached. The official source stays first; a mirror is only asked when it fails.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Do

func Do(c *http.Client, req *http.Request) (*http.Response, error)

Do sends req as usual and, when the official answer fails in a way a mirror could answer, tries its mirrors in order. A request that carries credentials is never sent to a mirror.

func DoOfficial

func DoOfficial(c *http.Client, req *http.Request) (*http.Response, error)

DoOfficial sends req to its official address alone. It is for a file whose checksum must come from the same trusted place as the file itself.

func Enabled

func Enabled() bool

Enabled reports whether mirror fallback was turned on with MAGPIE_MIRRORS=on (or true, 1, cn).

func URLs

func URLs(raw string) []string

URLs is the official address followed by its mirrors, or just the official one when there is no mirror for it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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