crproxy

package module
v0.13.0-alpha.25 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 17 Imported by: 0

README

CRProxy (Container Registry Proxy)

CRProxy is a generic image proxy

Add the prefix m.daocloud.io/ to all places that need to use images

m.daocloud.io

you can deploy your own image proxy server if you need to.

Refer to

crproxy + registry(pull through cache mode)

  • for organizations and companies which need to serve big clusters
  • container-image-mirror
    • deploy into k8s with argocd
    • storage with pvc, s3(minio/oss compatible)
    • bind ssl with cert-manager and ingress

On Docker

Just add the prefix m.daocloud.io/

docker pull m.daocloud.io/docker.io/library/busybox

On Kubernetes

Just add the prefix m.daocloud.io/

image: m.daocloud.io/docker.io/library/busybox

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSleepDuration

func GetSleepDuration(s geario.B, limit geario.B, r time.Duration) time.Duration

Types

type BlockInfo added in v0.12.3

type BlockInfo struct {
	IP   string
	Host string
	Name string
}

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 ImageInfo added in v0.8.0

type ImageInfo struct {
	Host string
	Name string
}

type InfoCtxValue added in v0.9.0

type InfoCtxValue struct {
	LastRedirect string
}

func GetCtxValue added in v0.9.0

func GetCtxValue(ctx context.Context) *InfoCtxValue

type Option

type Option func(c *CRProxy)

func WithAuthenticator

func WithAuthenticator(authenticator *token.Authenticator) Option

func WithBlobsSpeedLimit

func WithBlobsSpeedLimit(limit geario.B, duration time.Duration) Option

func WithBlockFunc

func WithBlockFunc(blockFunc func(info *BlockInfo) (string, bool)) Option

func WithCache

func WithCache(cache *cache.Cache) Option

func WithDefaultRegistry added in v0.8.0

func WithDefaultRegistry(target string) Option

func WithDisableTagsList

func WithDisableTagsList(b bool) Option

func WithDomainAlias

func WithDomainAlias(domainAlias map[string]string) Option

func WithIPsSpeedLimit

func WithIPsSpeedLimit(limit geario.B, duration time.Duration) Option

func WithLimitDelay

func WithLimitDelay(b bool) Option

func WithLogger

func WithLogger(logger *slog.Logger) Option

func WithManifestCacheDuration added in v0.12.0

func WithManifestCacheDuration(d time.Duration) Option

func WithOverrideDefaultRegistry added in v0.8.0

func WithOverrideDefaultRegistry(overrideDefaultRegistry map[string]string) Option

func WithPathInfoModifyFunc

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

func WithPrivilegedFunc added in v0.9.0

func WithPrivilegedFunc(f func(r *http.Request, info *ImageInfo) bool) Option

func WithPrivilegedNoAuth added in v0.8.0

func WithPrivilegedNoAuth(b bool) Option

func WithRedirectToOriginBlobFunc added in v0.9.0

func WithRedirectToOriginBlobFunc(f func(r *http.Request, info *ImageInfo) bool) Option

func WithSimpleAuth added in v0.8.0

func WithSimpleAuth(b bool) Option

func WithTotalBlobsSpeedLimit

func WithTotalBlobsSpeedLimit(limit geario.B) Option

func WithTransport

func WithTransport(transport http.RoundTripper) Option

type PathInfo

type PathInfo struct {
	Host  string
	Image string

	TagsList  bool
	Manifests string
	Blobs     string
}

func ParseOriginPathInfo

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

func (PathInfo) Path

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

Directories

Path Synopsis
cmd
internal
pki
storage

Jump to

Keyboard shortcuts

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