packagist

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ComposerAuth

type ComposerAuth struct {
	HTTPBasicAuth  map[string]ComposerAuthHttpBasic `json:"http-basic,omitempty"`
	BearerAuth     map[string]string                `json:"bearer,omitempty"`
	GitlabAuth     map[string]GitlabToken           `json:"gitlab-token,omitempty"`
	GitlabOAuth    map[string]GitlabOAuthToken      `json:"gitlab-oauth,omitempty"`
	GithubOAuth    map[string]string                `json:"github-oauth,omitempty"`
	BitbucketOauth map[string]map[string]string     `json:"bitbucket-oauth,omitempty"`
	CustomHeaders  map[string][]string              `json:"custom-headers,omitempty"`
	GitlabDomains  []string                         `json:"gitlab-domains,omitempty"`
	GithubDomains  []string                         `json:"github-domains,omitempty"`
	// contains filtered or unexported fields
}

func ReadComposerAuth

func ReadComposerAuth(authFile string) (*ComposerAuth, error)

func (*ComposerAuth) Json

func (a *ComposerAuth) Json(formatted bool) ([]byte, error)

func (*ComposerAuth) Save

func (a *ComposerAuth) Save() error

type ComposerAuthHttpBasic

type ComposerAuthHttpBasic struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type ComposerFunding

type ComposerFunding struct {
	Type string `json:"type,omitempty"`
	URL  string `json:"url,omitempty"`
}

type ComposerJson

type ComposerJson struct {
	Name               string                   `json:"name"`
	Abandoned          bool                     `json:"abandoned,omitempty"`
	Bin                []string                 `json:"bin,omitempty"`
	Description        string                   `json:"description,omitempty"`
	Version            string                   `json:"version,omitempty"`
	Type               string                   `json:"type,omitempty"`
	Keywords           []string                 `json:"keywords,omitempty"`
	Homepage           string                   `json:"homepage,omitempty"`
	Readme             string                   `json:"readme,omitempty"`
	Time               string                   `json:"time,omitempty"`
	License            string                   `json:"license,omitempty"`
	MinimumStability   string                   `json:"minimum-stability,omitempty"`
	PreferStable       bool                     `json:"prefer-stable,omitempty"`
	Authors            []ComposerJsonAuthor     `json:"authors,omitempty"`
	Support            *ComposerJsonSupport     `json:"support,omitempty"`
	Funding            []ComposerFunding        `json:"funding,omitempty"`
	Require            ComposerPackageLink      `json:"require,omitempty"`
	RequireDev         ComposerPackageLink      `json:"require-dev,omitempty"`
	Conflict           ComposerPackageLink      `json:"conflict,omitempty"`
	Replace            ComposerPackageLink      `json:"replace,omitempty"`
	Provide            ComposerPackageLink      `json:"provide,omitempty"`
	Autoload           ComposerJsonAutoload     `json:"autoload,omitempty"`
	AutoloadDev        ComposerJsonAutoload     `json:"autoload-dev,omitempty"`
	Repositories       ComposerJsonRepositories `json:"repositories,omitempty"`
	Config             map[string]any           `json:"config,omitempty"`
	Scripts            map[string]any           `json:"scripts,omitempty"`
	Extra              map[string]any           `json:"extra,omitempty"`
	Suggest            map[string]string        `json:"suggest,omitempty"`
	NonFeatureBranches []string                 `json:"non-feature-branches,omitempty"`
	// contains filtered or unexported fields
}

func ReadComposerJson

func ReadComposerJson(composerPath string) (*ComposerJson, error)

func (*ComposerJson) EnableComposerPlugin

func (c *ComposerJson) EnableComposerPlugin(name string)

func (*ComposerJson) HasConfig

func (c *ComposerJson) HasConfig(key string) bool

func (*ComposerJson) HasPackage

func (c *ComposerJson) HasPackage(name string) bool

func (*ComposerJson) HasPackageDev

func (c *ComposerJson) HasPackageDev(name string) bool

func (*ComposerJson) RemoveComposerPlugin

func (c *ComposerJson) RemoveComposerPlugin(name string)

func (*ComposerJson) Save

func (c *ComposerJson) Save() error

type ComposerJsonAuthor

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

type ComposerJsonAutoload

type ComposerJsonAutoload struct {
	Psr0     map[string]string `json:"psr-0,omitempty"`
	Psr4     map[string]string `json:"psr-4,omitempty"`
	Classmap []string          `json:"classmap,omitempty"`
	Files    []string          `json:"files,omitempty"`
	Exclude  []string          `json:"exclude-from-classmap,omitempty"`
}

type ComposerJsonRepositories

type ComposerJsonRepositories []ComposerJsonRepository

func (*ComposerJsonRepositories) HasRepository

func (r *ComposerJsonRepositories) HasRepository(url string) bool

func (*ComposerJsonRepositories) UnmarshalJSON

func (e *ComposerJsonRepositories) UnmarshalJSON(data []byte) error

type ComposerJsonRepository

type ComposerJsonRepository struct {
	Type    string         `json:"type,omitempty"`
	URL     string         `json:"url,omitempty"`
	Options map[string]any `json:"options,omitempty"`
}

type ComposerJsonSupport

type ComposerJsonSupport struct {
	Email    string `json:"email,omitempty"`
	Issues   string `json:"issues,omitempty"`
	Forum    string `json:"forum,omitempty"`
	Wiki     string `json:"wiki,omitempty"`
	IRC      string `json:"irc,omitempty"`
	Source   string `json:"source,omitempty"`
	Docs     string `json:"docs,omitempty"`
	RSS      string `json:"rss,omitempty"`
	Chat     string `json:"chat,omitempty"`
	Security string `json:"security,omitempty"`
}

type ComposerLock

type ComposerLock struct {
	Packages []ComposerLockPackage `json:"packages"`
}

func ReadComposerLock

func ReadComposerLock(pathToFile string) (*ComposerLock, error)

func (*ComposerLock) GetPackage

func (c *ComposerLock) GetPackage(name string) *ComposerLockPackage

type ComposerLockPackage

type ComposerLockPackage struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}
type ComposerPackageLink map[string]string

type GitlabOAuthToken

type GitlabOAuthToken struct {
	ExpiresAt    int64  `json:"expires-at,omitempty"`
	RefreshToken string `json:"refresh-token,omitempty"`
	Token        string `json:"token"`
}

func (GitlabOAuthToken) MarshalJSON

func (t GitlabOAuthToken) MarshalJSON() ([]byte, error)

func (*GitlabOAuthToken) UnmarshalJSON

func (t *GitlabOAuthToken) UnmarshalJSON(data []byte) error

type GitlabToken

type GitlabToken struct {
	Username string
	Token    string
}

func (GitlabToken) MarshalJSON

func (t GitlabToken) MarshalJSON() ([]byte, error)

func (*GitlabToken) UnmarshalJSON

func (t *GitlabToken) UnmarshalJSON(data []byte) error

type PackageResponse

type PackageResponse struct {
	Packages map[string]map[string]PackageVersion `json:"packages"`
}

func GetPackages

func GetPackages(ctx context.Context, token string) (*PackageResponse, error)

func (*PackageResponse) HasPackage

func (p *PackageResponse) HasPackage(name string) bool

type PackageVersion

type PackageVersion struct {
	Version string            `json:"version"`
	Replace map[string]string `json:"replace"`
}

Jump to

Keyboard shortcuts

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