api

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(options ...Option) http.Handler

New returns a configured http.Handler which implements GOPROXY API.

Types

type Option

type Option func(*api)

Option configures an API handler.

func CacheDir

func CacheDir(dir string) Option

CacheDir configures API to use a local disk storage for downloaded modules.

func CustomVCS

func CustomVCS(prefix string, cmd string) Option

func Git

func Git(prefix, key, password string) Option

Git configures API to use a specific git client when trying to download a repository with the given prefix. Auth string can be a path to the SSK key, or a colon-separated username:password string.

func GitDir

func GitDir(dir string) Option

GitDir configures API to use a specific directory for bare git repos.

func GitWithEphemeralTags

func GitWithEphemeralTags(prefix, key, password string) Option

GitWithEphemeralTags configures API to use a specific git client when trying to download a repository with the given prefix. Auth string can be a path to the SSK key, or a colon-separated username:password string.

func Log

func Log(log logger) Option

Log configures API to use a specific logger function, such as log.Println, testing.T.Log or any other custom logger.

func Memory

func Memory(log logger, limit int64) Option

Memory configures API to use in-memory cache for downloaded modules.

func VCSWorkers

func VCSWorkers(n int) Option

VCSWorkers configures API to use at most n parallel workers when fetching from the VCS. The reason to restrict number of workers is to limit their memory usage.

Jump to

Keyboard shortcuts

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