gorepo

package
v0.0.0-...-4ddab7f Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: LGPL-2.1 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathTypeListModule          = "$base/$module/@v/list"
	PathTypeModuleMeta          = "$base/$module/@v/$version.info"
	PathTypeModuleVersion       = "$base/$module/@v/$version.mod"
	PathTypeModuleContent       = "$base/$module/@v/$version.zip"
	PathTypeModuleLatestVersion = "$base/$module/@latest"

	PathTypeSumProxy          = "<proxyURL>/sumdb/<databaseURL>"
	PathTypeSumProxySupported = "<proxyURL>/sumdb/<sumdb-name>/supported"
)
View Source
const (
	TriggerLoadAllVersionsAndLatestVersion = "PathTypeListModule,PathTypeModuleLatestVersion"
)

Variables

View Source
var (
	ErrResourceNotFound    = errors.New("not found/404")
	ErrResourceForbidden   = errors.New("forbidden/403")
	ErrResourceClientError = errors.New("other client error/4xx")
	ErrResourceServerError = errors.New("server error/5xx")
)

Functions

func Init

func Init(engine *gin.Engine, c *config.Config)

Types

type GoModuleRepository

type GoModuleRepository interface {
	// FetchResource fetch uri data & content-type with error if failed
	FetchResource(uri string, pathType string) ([]byte, string, error)

	SupportSumDBProxy(uri string) (bool, error)

	UploadResource(uri string, data []byte) error
	SupportUpload(uri string) (bool, error)
}

func NewLocalCacheRepo

func NewLocalCacheRepo(conf config.GoRepoConf, c *config.Config, sourceRepo GoModuleRepository) GoModuleRepository

func NewProxyRepo

func NewProxyRepo(conf config.GoRepoConf, gc *config.Config) GoModuleRepository

Jump to

Keyboard shortcuts

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