pkgmirror

package module
v0.0.0-...-452f874 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: MIT Imports: 17 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Pkg Mirrors

Build Status Coverage Status

This project aims to provides mirroring features for:

  • composer: a php package manager.
  • git: clone mirror and sync repo repository.
  • npm: a NodeJS package manager.
  • bower: a front-end package manager.

Please note, if you only need to proxy packagist, please consider Toran Proxy as a strong alternative.

Documentations

User guide
Internals

GUI

alt text

Documentation

Index

Constants

View Source
const (
	STATUS_RUNNING = 1
	STATUS_HOLD    = 2
	STATUS_ERROR   = 3
)

Variables

View Source
var (

	// ErrPathRequired is returned when the path to a Bolt database is not specified.
	ErrPathRequired = errors.New("path required")

	// ErrFileNotFound is returned when a Bolt database does not exist.
	ErrFileNotFound = errors.New("file not found")

	ErrUnableToCloseDatabase = errors.New("Unable to close the database")
)
View Source
var (
	SyncInProgressError   = errors.New("A synchronization is already running")
	DatabaseLockedError   = errors.New("The database is locked")
	EmptyKeyError         = errors.New("No value available")
	ResourceNotFoundError = errors.New("Resource not found")
	EmptyDataError        = errors.New("Empty data")
	SameKeyError          = errors.New("Same key")
	HttpError             = errors.New("Http error")
	InvalidPackageError   = errors.New("Invalid package error")
	InvalidReferenceError = errors.New("Invalid reference")
)

Functions

func Compress

func Compress(data []byte) ([]byte, error)

func Decompress

func Decompress(data []byte) ([]byte, error)

func GetApp

func GetApp(conf *Config, l *goapp.Lifecycle) (*goapp.App, error)

func GetStateChannel

func GetStateChannel(id string, primary chan State) chan State

func LoadRemoteStruct

func LoadRemoteStruct(url string, v interface{}) error

func LoadStruct

func LoadStruct(file string, v interface{}) error

func Marshal

func Marshal(v interface{}) ([]byte, error)

func NewWorkerManager

func NewWorkerManager(process int, processCallback FuncProcess) *workerManager

func OpenDatabaseWithBucket

func OpenDatabaseWithBucket(basePath string, bucket []byte) (db *bolt.DB, err error)

func SendWithHttpCode

func SendWithHttpCode(res http.ResponseWriter, code int, message string)

func Serialize

func Serialize(w io.Writer, data interface{}) error

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Types

type BoltCompacter

type BoltCompacter struct {
	TxMaxSize int64
	Logger    *log.Logger
}

func (*BoltCompacter) Compact

func (bc *BoltCompacter) Compact(srcPath string) (err error)

Run executes the command.

type BowerConfig

type BowerConfig struct {
	Server  string
	Enabled bool
	Icon    string
}

type ComposerConfig

type ComposerConfig struct {
	Server  string
	Enabled bool
	Icon    string
}

type Config

type Config struct {
	DataDir        string
	LogDir         string
	CacheDir       string
	PublicServer   string
	InternalServer string
	LogLevel       string
	Composer       map[string]*ComposerConfig
	Npm            map[string]*NpmConfig
	Git            map[string]*GitConfig
	Bower          map[string]*BowerConfig
	Static         map[string]*StaticConfig
}

type FuncProcess

type FuncProcess func(id int, data <-chan interface{}, result chan interface{})

type FuncResult

type FuncResult func(raw interface{})

type GitConfig

type GitConfig struct {
	Server  string
	Enabled bool
	Icon    string
	Clone   string
}

type MirrorService

type MirrorService interface {
	Init(app *goapp.App) error
	Serve(state *goapp.GoroutineState) error
}

type NpmConfig

type NpmConfig struct {
	Server    string
	Enabled   bool
	Icon      string
	Fallbacks []*struct {
		Server string
	}
}

type SseBroker

type SseBroker struct {
	// Events are pushed to this channel by the main events-gathering routine
	Notifier chan []byte
	// contains filtered or unexported fields
}

code adapted from https://gist.github.com/ismasan/3fb75381cd2deb6bfa9c

func NewSseBroker

func NewSseBroker() *SseBroker

func (*SseBroker) Handler

func (broker *SseBroker) Handler(rw http.ResponseWriter, req *http.Request)

func (*SseBroker) Listen

func (broker *SseBroker) Listen()

func (*SseBroker) OnConnect

func (broker *SseBroker) OnConnect(fn func())

type State

type State struct {
	Id      string
	Status  int
	Message string
}

type StaticConfig

type StaticConfig struct {
	Server  string
	Enabled bool
	Icon    string
}

Directories

Path Synopsis
mirror
git
npm

Jump to

Keyboard shortcuts

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