Help us shape the future of Go! Take the 2026 Go Developer Survey

composer

package
v3.1.61 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2026 License: MIT, MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadPackageFile

func DownloadPackageFile(ctx *context.Context)

DownloadPackageFile serves the content of a package

func EnumeratePackages

func EnumeratePackages(ctx *context.Context)

EnumeratePackages lists all package names https://packagist.org/apidoc#list-packages

func PackageMetadata

func PackageMetadata(ctx *context.Context)

PackageMetadata returns the metadata for a single package https://packagist.org/apidoc#get-package-data

func SearchPackages

func SearchPackages(ctx *context.Context)

SearchPackages searches packages, only "q" is supported https://packagist.org/apidoc#search-packages

func ServiceIndex

func ServiceIndex(ctx *context.Context)

ServiceIndex displays registry endpoints

func UploadPackage

func UploadPackage(ctx *context.Context)

UploadPackage creates a new package

Types

type Dist

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

Dist contains package download information

type PackageMetadataResponse

type PackageMetadataResponse struct {
	Minified string                               `json:"minified"`
	Packages map[string][]*PackageVersionMetadata `json:"packages"`
}

PackageMetadataResponse contains packages metadata

type PackageVersionMetadata

type PackageVersionMetadata struct {
	*composer_module.Metadata
	Name    string    `json:"name"`
	Version string    `json:"version"`
	Type    string    `json:"type"`
	Created time.Time `json:"time"`
	Dist    Dist      `json:"dist"`
	Source  Source    `json:"source"`
}

PackageVersionMetadata contains package metadata https://getcomposer.org/doc/05-repositories.md#package

type SearchResult

type SearchResult struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Downloads   int64  `json:"downloads"`
}

SearchResult contains a search result

type SearchResultResponse

type SearchResultResponse struct {
	Total    int64           `json:"total"`
	Results  []*SearchResult `json:"results"`
	NextLink string          `json:"next,omitempty"`
}

SearchResultResponse contains search results

type ServiceIndexResponse

type ServiceIndexResponse struct {
	SearchTemplate   string `json:"search"`
	MetadataTemplate string `json:"metadata-url"`
	PackageList      string `json:"list"`
}

ServiceIndexResponse contains registry endpoints

type Source

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

Source contains package source information

Source Files

  • api.go
  • composer.go

Jump to

Keyboard shortcuts

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