composer

package
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: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureApp

func ConfigureApp(config *pkgmirror.Config, l *goapp.Lifecycle)

func ConfigureHttp

func ConfigureHttp(name string, conf *pkgmirror.ComposerConfig, app *goapp.App)

func NewPackageInfoPat

func NewPackageInfoPat(code string) goji.Pattern

func NewPackagePat

func NewPackagePat(code string) goji.Pattern

Types

type ComposerConfig

type ComposerConfig struct {
	SourceServer     string
	PublicServer     string
	BasePublicServer string
	Code             []byte
	Path             string
}

type ComposerService

type ComposerService struct {
	DB     *bolt.DB
	Config *ComposerConfig
	Logger *log.Entry

	StateChan     chan pkgmirror.State
	ProvidersURL  string
	BoltCompacter *pkgmirror.BoltCompacter
	// contains filtered or unexported fields
}

func NewComposerService

func NewComposerService() *ComposerService

func (*ComposerService) CleanPackages

func (ps *ComposerService) CleanPackages() error

func (*ComposerService) Get

func (ps *ComposerService) Get(key string) ([]byte, error)

func (*ComposerService) GetPackage

func (ps *ComposerService) GetPackage(key string) (*PackageInformation, error)

func (*ComposerService) Init

func (ps *ComposerService) Init(app *goapp.App) (err error)

func (*ComposerService) Serve

func (ps *ComposerService) Serve(state *goapp.GoroutineState) error

func (*ComposerService) SyncPackages

func (ps *ComposerService) SyncPackages() error

func (*ComposerService) UpdateEntryPoints

func (ps *ComposerService) UpdateEntryPoints() error

This method generates the different entry points required by a repository.

func (*ComposerService) UpdatePackage

func (ps *ComposerService) UpdatePackage(name string) error

type Package

type Package struct {
	Name              string           `json:"name,omitempty"`
	Abandoned         *json.RawMessage `json:"abandoned,omitempty"`
	Description       string           `json:"description,omitempty"`
	Keywords          *json.RawMessage `json:"keywords,omitempty"`
	Homepage          string           `json:"homepage,omitempty"`
	Version           string           `json:"version,omitempty"`
	VersionNormalized string           `json:"version_normalized,omitempty"`
	License           *json.RawMessage `json:"license,omitempty"`
	Bin               []string         `json:"bin,omitempty"`
	Authors           []struct {
		Name     string `json:"name"`
		Email    string `json:"email"`
		Homepage string `json:"homepage"`
		Role     string `json:"role"`
	} `json:"authors,omitempty"`
	Source struct {
		Type      string `json:"type"`
		URL       string `json:"url"`
		Reference string `json:"reference"`
	} `json:"source,omitempty"`
	Dist struct {
		Type      string `json:"type"`
		URL       string `json:"url"`
		Reference string `json:"reference"`
		Shasum    string `json:"shasum"`
	} `json:"dist,omitempty"`
	Extra      *json.RawMessage `json:"extra,omitempty"`
	TargetDir  string           `json:"target-dir,omitempty"`
	Type       string           `json:"type,omitempty"`
	Time       time.Time        `json:"time,omitempty"`
	Autoload   *json.RawMessage `json:"autoload,omitempty"`
	Replace    *json.RawMessage `json:"replace,omitempty"`
	Conflict   *json.RawMessage `json:"conflict,omitempty"`
	Provide    *json.RawMessage `json:"provide,omitempty"`
	Require    *json.RawMessage `json:"require,omitempty"`
	RequireDev *json.RawMessage `json:"require-dev,omitempty"`
	Suggest    *json.RawMessage `json:"suggest,omitempty"`
	UID        *json.RawMessage `json:"uid,omitempty"`
}

package description

type PackageInfoPat

type PackageInfoPat struct {
	Pattern *regexp.Regexp
}

func (*PackageInfoPat) Match

type PackageInformation

type PackageInformation struct {
	Server        string        `json:"server"`
	PackageResult PackageResult `json:"-"`
	Package       string        `json:"package"`
	Exist         bool          `json:"-"`
	HashSource    string        `json:"hash_source"`
	HashTarget    string        `json:"hash_target"`
	Url           string        `json:"-"`
}

func (*PackageInformation) GetTargetKey

func (pi *PackageInformation) GetTargetKey() string

type PackagePat

type PackagePat struct {
	Pattern *regexp.Regexp
}

func (*PackagePat) Match

func (pp *PackagePat) Match(ctx context.Context, r *http.Request) context.Context

type PackageResult

type PackageResult struct {
	Packages map[string]map[string]*Package `json:"packages"`
}

used to load the packages.json file

type PackagesResult

type PackagesResult struct {
	Packages         json.RawMessage `json:"packages"`
	Notify           string          `json:"notify"`
	NotifyBatch      string          `json:"notify-batch"`
	ProvidersURL     string          `json:"providers-url"`
	Search           string          `json:"search"`
	ProviderIncludes ProviderInclude `json:"provider-includes"`
}

type ProviderInclude

type ProviderInclude map[string]struct {
	Sha256 string `json:"sha256"`
}

type ProvidersResult

type ProvidersResult struct {
	Providers map[string]struct {
		Sha256 string `json:"sha256"`
	} `json:"providers"`
	Code string `json:"-"`
}

Jump to

Keyboard shortcuts

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