crproxy

package module
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: MIT Imports: 14 Imported by: 0

README

CRProxy (Container Registry Proxy)

CRProxy is a generic image proxy

Add the prefix cr.zsm.io/ to all places that need to use images

cr.zsm.io

This is an experimental server and is not guaranteed to be stable,
so you can deploy your own image proxy server if you need to.

Refer to

On Docker

Just add the prefix cr.zsm.io/

docker pull cr.zsm.io/docker.io/library/busybox

On Kubernetes

Just add the prefix cr.zsm.io/

image: cr.zsm.io/docker.io/library/busybox

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRProxy

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

func NewCRProxy

func NewCRProxy(opts ...Option) (*CRProxy, error)

func (*CRProxy) ServeHTTP

func (c *CRProxy) ServeHTTP(rw http.ResponseWriter, r *http.Request)

type Logger

type Logger interface {
	Println(v ...interface{})
}

type Option added in v0.0.4

type Option func(c *CRProxy)

func WithBaseClient added in v0.0.4

func WithBaseClient(baseClient *http.Client) Option

func WithBlobsSpeedLimit added in v0.4.0

func WithBlobsSpeedLimit(limit geario.B) Option

func WithDisableKeepAlives added in v0.5.0

func WithDisableKeepAlives(disableKeepAlives []string) Option

func WithDomainAlias added in v0.2.0

func WithDomainAlias(domainAlias map[string]string) Option

func WithLogger added in v0.0.4

func WithLogger(logger Logger) Option

func WithMaxClientSizeForEachRegistry added in v0.2.0

func WithMaxClientSizeForEachRegistry(clientSize int) Option

func WithPathInfoModifyFunc added in v0.3.0

func WithPathInfoModifyFunc(modify func(info *PathInfo) *PathInfo) Option

func WithTotalBlobsSpeedLimit added in v0.4.0

func WithTotalBlobsSpeedLimit(limit geario.B) Option

func WithUserAndPass added in v0.2.0

func WithUserAndPass(userAndPass map[string]Userpass) Option

type PathInfo added in v0.3.0

type PathInfo struct {
	Host  string
	Image string

	TagsList  bool
	Manifests string
	Blobs     string
}

func ParseOriginPathInfo added in v0.3.0

func ParseOriginPathInfo(path string) (*PathInfo, bool)

func (PathInfo) Path added in v0.3.0

func (p PathInfo) Path() (string, error)

type Userpass added in v0.2.0

type Userpass struct {
	Username string
	Password string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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