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: 14 Imported by: 0

Documentation

Index

Constants

View Source
const TypeProperty = "composer.type"

TypeProperty is the name of the property for Composer package types

Variables

View Source
var (
	// ErrMissingComposerFile indicates a missing composer.json file
	ErrMissingComposerFile = util.NewInvalidArgumentErrorf("composer.json file is missing")
	// ErrInvalidName indicates an invalid package name
	ErrInvalidName = util.NewInvalidArgumentErrorf("package name is invalid")
	// ErrInvalidVersion indicates an invalid package version
	ErrInvalidVersion = util.NewInvalidArgumentErrorf("package version is invalid")
)

Functions

This section is empty.

Types

type Author

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

Author represents an author

type Comments

type Comments []string

Comments represents the comments of a Composer package

func (*Comments) UnmarshalJSON

func (c *Comments) UnmarshalJSON(data []byte) error

UnmarshalJSON reads from a string or array

type Licenses

type Licenses []string

Licenses represents the licenses of a Composer package

func (*Licenses) UnmarshalJSON

func (l *Licenses) UnmarshalJSON(data []byte) error

UnmarshalJSON reads from a string or array

type Metadata

type Metadata struct {
	Description string            `json:"description,omitempty"`
	Readme      string            `json:"readme,omitempty"`
	Keywords    []string          `json:"keywords,omitempty"`
	Comments    Comments          `json:"_comment,omitempty"`
	Homepage    string            `json:"homepage,omitempty"`
	License     Licenses          `json:"license,omitempty"`
	Authors     []Author          `json:"authors,omitempty"`
	Bin         []string          `json:"bin,omitempty"`
	Autoload    map[string]any    `json:"autoload,omitempty"`
	AutoloadDev map[string]any    `json:"autoload-dev,omitempty"`
	Extra       map[string]any    `json:"extra,omitempty"`
	Require     map[string]string `json:"require,omitempty"`
	RequireDev  map[string]string `json:"require-dev,omitempty"`
	Suggest     map[string]string `json:"suggest,omitempty"`
	Provide     map[string]string `json:"provide,omitempty"`
}

Metadata represents the metadata of a Composer package

type PackageInfo

type PackageInfo struct {
	Filename string

	Name     string
	Version  string
	Type     string
	Metadata *Metadata
}

PackageInfo represents Composer package info

func ParsePackage

func ParsePackage(r ReadSeekAt, optVersion ...string) (*PackageInfo, error)

ParsePackage parses the metadata of a Composer package file

type ReadSeekAt

type ReadSeekAt interface {
	io.Reader
	io.ReaderAt
	io.Seeker
	Size() int64
}

Source Files

  • metadata.go

Jump to

Keyboard shortcuts

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