pkgproxy

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Copyright 2026 Reto Gantenbein SPDX-License-Identifier: Apache-2.0

Copyright 2022 Reto Gantenbein SPDX-License-Identifier: Apache-2.0

Copyright 2022 Reto Gantenbein SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LandingHandler

func LandingHandler(config *RepoConfig, publicAddr string) echo.HandlerFunc

LandingHandler returns an Echo handler that renders an HTML overview page listing all configured repositories, their mirrors, and package manager snippets. publicAddr is the address (host or host:port) rendered in config snippets.

func LoadConfig

func LoadConfig(config *RepoConfig, path string) error

Types

type PkgProxy

type PkgProxy interface {
	Cache(echo.HandlerFunc) echo.HandlerFunc
	ForwardProxy(echo.HandlerFunc) echo.HandlerFunc
}

func New

func New(config *PkgProxyConfig) PkgProxy

type PkgProxyConfig

type PkgProxyConfig struct {
	CacheBasePath    string
	RepositoryConfig *RepoConfig

	// To customize the transport to remote.
	// Examples: If custom TLS certificates are required.
	Transport http.RoundTripper
}

type RepoConfig

type RepoConfig struct {
	Repositories map[string]Repository `yaml:"repositories"`
}

RepoConfig defines the upstream package repositories

type Repository

type Repository struct {
	CacheSuffixes []string `yaml:"suffixes"`
	Mirrors       []string `yaml:"mirrors"`
	Retries       int      `yaml:"retries,omitempty"`
}

Jump to

Keyboard shortcuts

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