composer

package
v0.0.0-...-016bef1 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(conf *Config) error

Generate generates the repository.

func Update

func Update(conf *Config, packageInfos []*PackageInfo) error

Update updates packages in the repository.

Types

type ArchiveOptions

type ArchiveOptions struct {
	Exclude []string `json:"exclude,omitempty" msgpack:"exclude"`
}

type Author

type Author struct {
	Name     string `json:"name,omitempty" msgpack:"name"`
	Email    string `json:"email,omitempty" msgpack:"email"`
	Homepage string `json:"homepage,omitempty" msgpack:"homepage"`
	Role     string `json:"role,omitempty" msgpack:"role"`
}

type Config

type Config struct {
	UseProviders bool
	Inputs       map[string]Input
	Transformers []Transformer
	Output       Output
}

type Dist

type Dist struct {
	URL  string `json:"url" msgpack:"url"`
	Type string `json:"type" msgpack:"type"`
}

type Input

type Input interface {
	Init(id string, conf map[string]interface{}) error

	GetID() string
	GetName() string
	GetPackages() (Packages, error)
	GetPackage(packageName string) (PackageVersions, error)
}

type Output

type Output interface {
	Init(conf map[string]interface{}) error

	GetBasePath() string

	Get(name string) ([]byte, error)
	Write(name string, data []byte) error
}

type Package

type Package struct {
	UID                string                 `json:"uid,omitempty" msgpack:"uid"`
	Name               string                 `json:"name,omitempty" msgpack:"name"`
	Description        string                 `json:"description,omitempty" msgpack:"description"`
	Version            string                 `json:"version,omitempty" msgpack:"version"`
	Type               string                 `json:"type,omitempty" msgpack:"type"`
	Keywords           []string               `json:"keywords,omitempty" msgpack:"keywords"`
	Homepage           string                 `json:"homepage,omitempty" msgpack:"homepage"`
	Readme             string                 `json:"readme,omitempty" msgpack:"readme"`
	Time               *time.Time             `json:"time,omitempty" msgpack:"time"`
	License            interface{}            `json:"license,omitempty" msgpack:"license"`
	Authors            []Author               `json:"authors,omitempty" msgpack:"authors"`
	Support            *Support               `json:"support,omitempty" msgpack:"support"`
	Require            PackageLink            `json:"require,omitempty" msgpack:"require"`
	RequireDev         PackageLink            `json:"require-dev,omitempty" msgpack:"require-dev"`
	Conflict           PackageLink            `json:"conflict,omitempty" msgpack:"conflict"`
	Replace            PackageLink            `json:"replace,omitempty" msgpack:"replace"`
	Provide            PackageLink            `json:"provide,omitempty" msgpack:"provide"`
	Suggest            PackageLink            `json:"suggest,omitempty" msgpack:"suggest"`
	Autoload           map[string]interface{} `json:"autoload,omitempty" msgpack:"autoload"`
	AutoloadDev        map[string]interface{} `json:"autoload-dev,omitempty" msgpack:"autoload-dev"`
	IncludePath        []string               `json:"include-path,omitempty" msgpack:"include-path"`
	TargetDir          string                 `json:"target-dir,omitempty" msgpack:"target-dir"`
	MinimumStability   string                 `json:"minimum-stability,omitempty" msgpack:"minimum-stability"`
	PreferStable       bool                   `json:"prefer-stable,omitempty" msgpack:"prefer-stable"`
	Repositories       interface{}            `json:"repositories,omitempty" msgpack:"repositories"`
	Config             interface{}            `json:"config,omitempty" msgpack:"config"`
	Scripts            interface{}            `json:"scripts,omitempty" msgpack:"scripts"`
	Extra              interface{}            `json:"extra,omitempty" msgpack:"extra"`
	Bin                []string               `json:"bin,omitempty" msgpack:"bin"`
	Archive            *ArchiveOptions        `json:"archive,omitempty" msgpack:"archive"`
	Abandoned          bool                   `json:"abandoned,omitempty" msgpack:"abondoned"`
	NonFeatureBranches []string               `json:"non-feature-branches,omitempty" msgpack:"non-feature-branches"`
	Dist               *Dist                  `json:"dist,omitempty" msgpack:"dist"`
	Source             *Source                `json:"source,omitempty" msgpack:"source"`
}

type PackageInfo

type PackageInfo struct {
	InputID     string
	PackageName string
}
type PackageLink map[string]string

type PackageVersions

type PackageVersions map[string]*Package

type Packages

type Packages map[string]PackageVersions

type Reference

type Reference struct {
	SHA256 string `json:"sha256"`
}

type Repository

type Repository struct {
	Packages          Packages              `json:"packages,omitempty"`
	Providers         map[string]*Reference `json:"providers,omitempty"`
	ProviderIncludes  map[string]*Reference `json:"provider-includes,omitempty"`
	ProvidersURL      string                `json:"providers-url,omitempty"`
	MetadataURL       string                `json:"metadata-url,omitempty"`
	AvailablePackages []string              `json:"available-packages,omitempty"`
}

type Source

type Source struct {
	URL       string `json:"url" msgpack:"url"`
	Type      string `json:"type" msgpack:"type"`
	Reference string `json:"reference" msgpack:"reference"`
}

type Support

type Support struct {
	Email  string `json:"email,omitempty" msgpack:"email"`
	Issues string `json:"issues,omitempty" msgpack:"issues"`
	Forum  string `json:"forum,omitempty" msgpack:"forum"`
	Wiki   string `json:"wiki,omitempty" msgpack:"wiki"`
	IRC    string `json:"irc,omitempty" msgpack:"irc"`
	Source string `json:"source,omitempty" msgpack:"source"`
	Docs   string `json:"docs,omitempty" msgpack:"docs"`
	RSS    string `json:"rss,omitempty" msgpack:"rss"`
}

type Transformer

type Transformer interface {
	Init(id int, conf map[string]interface{}) error

	GetID() int

	Transform(input Input, name string, pkg PackageVersions) error
}

Jump to

Keyboard shortcuts

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