cpanmeta

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIVersion

type APIVersion struct {
	// Version is the version of CPAN::Meta::Spec that the metadata
	// conforms to.
	Version version.JSON `json:"version"`

	// URL is the URL of the specification document.
	URL string `json:"url"`
}

type File

type File struct {
	// File is the name of the file.
	File string `json:"file"`

	// Version is the version of the file.
	Version version.JSON `json:"version"`
}

type License

type License int

License indicates the license under which the distribution is released.

const (
	// LicenseUnknown is the default value for License, and implies that
	// the license info was not provided in the metadata.
	LicenseUnknown License = iota

	// LicenseOpenSource indicates an OSI-approved open source license not
	// covered by any of the other License constants.
	LicenseOpenSource

	// LicenseRestricted indicates a license requiring some form of
	// permission from the license holder to use the software.
	LicenseRestricted

	// LicenseUnrestricted indicates a license that does not require any
	// special permission, but is nonetheless not approved by the OSI.
	LicenseUnrestricted

	// LicenseAGPL3 indicates the software is licensed under the
	// GNU Affero General Public license, version 3.
	//
	// See also: https://opensource.org/licenses/agpl-3.0
	LicenseAGPL3

	// LicenseApache1_1 indicates the software is licensed under the
	// Apache license, version 1.1.
	//
	// See also: https://opensource.org/licenses/apache-1.1
	LicenseApache1_1

	// LicenseApache2_0 indicates the software is licensed under the
	// Apache license, version 2.0.
	//
	// See also: https://opensource.org/licenses/apache-2.0
	LicenseApache2_0

	// LicenseArtistic1 indicates the software is licensed under the
	// Artistic license, version 1.0.
	//
	// See also: https://opensource.org/licenses/artistic-1.0
	LicenseArtistic1

	// LicenseArtistic2 indicates the software is licensed under the
	// Artistic license, version 2.0.
	//
	// See also: https://opensource.org/licenses/artistic-2.0
	LicenseArtistic2

	// LicenseBSD indicates the software is licensed under the
	// 3-Clause BSD license.
	//
	// See also: https://opensource.org/licenses/BSD-3-Clause
	LicenseBSD

	// LicenseFreeBSD indicates the software is licensed under the
	// 2-Clause BSD license.
	//
	// See also: https://opensource.org/licenses/BSD-2-Clause
	LicenseFreeBSD

	// LicenseGFDL1_2 indicates the software is licensed under the
	// GNU Free Documentation license, version 1.2.
	//
	// See also: https://www.gnu.org/licenses/fdl-1.2.html
	LicenseGFDL1_2

	// LicenseGFDL1_3 indicates the software is licensed under the
	// GNU Free Documentation license, version 1.3.
	//
	// See also: https://www.gnu.org/licenses/fdl-1.3.html
	LicenseGFDL1_3

	// LicenseGPL1 indicates the software is licensed under the
	// GNU General Public license, version 1.
	//
	// See also: https://opensource.org/licenses/gpl-1.0
	LicenseGPL1

	// LicenseGPL2 indicates the software is licensed under the
	// GNU General Public license, version 2.
	//
	// See also: https://opensource.org/licenses/gpl-2.0
	LicenseGPL2

	// LicenseGPL3 indicates the software is licensed under the
	// GNU General Public license, version 3.
	//
	// See also: https://opensource.org/licenses/gpl-3.0
	LicenseGPL3

	// LicenseLGPL2_1 indicates the software is licensed under the
	// GNU Lesser General Public license, version 2.1.
	//
	// See also: https://opensource.org/licenses/LGPL-2.1
	LicenseLGPL2_1

	// LicenseLGPL3_0 indicates the software is licensed under the
	// GNU Lesser General Public license, version 3.0.
	//
	// See also: https://opensource.org/licenses/LGPL-3.0
	LicenseLGPL3_0

	// LicenseMIT indicates the software is licensed under the
	// MIT license.
	//
	// See also: https://opensource.org/licenses/MIT
	LicenseMIT

	// LicenseMozilla1_0 indicates the software is licensed under the
	// Mozilla Public license, version 1.0.
	//
	// See also: https://opensource.org/licenses/MPL-1.0
	LicenseMozilla1_0

	// LicenseMozilla1_1 indicates the software is licensed under the
	// Mozilla Public license, version 1.1.
	//
	// See also: https://opensource.org/licenses/MPL-1.1
	LicenseMozilla1_1

	// LicenseOpenSSL indicates the software is licensed under the
	// OpenSSL license.
	//
	// See also: https://www.openssl.org/source/license-openssl-ssleay.txt
	LicenseOpenSSL

	// LicensePerl5 indicates the software is licensed under the
	// [same terms as Perl 5 itself]. That is, LicensePerl5 is equivalent
	// to LicenseGPL1 and LicenseArtistic1.
	//
	// [same terms as Perl 5 itself]: https://dev.perl.org/licenses/
	LicensePerl5

	// LicenseQPL1_0 indicates the software is licensed under the
	// Q Public license, version 1.0.
	//
	// See also: https://opensource.org/licenses/QPL-1.0
	LicenseQPL1_0

	// LicenseSSLeay indicates the software is licensed under the
	// SSLeay license.
	//
	// See also: https://www.openssl.org/source/license-openssl-ssleay.txt
	LicenseSSLeay

	// LicenseSun indicates the software is licensed under the
	// Sun Industry Standards Source license.
	//
	// See also: https://opensource.org/licenses/SISSL
	LicenseSun

	// LicenseZlib indicates the software is licensed under the
	// zlib license.
	//
	// See also: https://opensource.org/licenses/Zlib
	LicenseZlib
)

func NewLicense

func NewLicense(str string) (License, error)

func (*License) MarshalJSON

func (l *License) MarshalJSON() ([]byte, error)

func (*License) String

func (l *License) String() string

func (*License) UnmarshalJSON

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

type NoIndex

type NoIndex struct {
	// File is a list of files that should not be indexed.
	File []string `json:"file"`

	// Directory is a list of directories that should not be indexed.
	Directory []string `json:"directory"`

	// Package is a list of packages that should not be indexed.
	Package []string `json:"package"`

	// Namespace is a list of namespaces that should not be indexed.
	Namespace []string `json:"namespace"`
}

type OptionalFeature

type OptionalFeature struct {
	// Description is a description of the feature.
	Description string `json:"description"`

	// Prereqs is a list of prerequisites for the feature.
	Prereqs Prereqs `json:"prereqs"`
}

type Phase

type Phase struct {
	// Conflicts is a list of modules that conflict with this phase.
	Conflicts map[string]version.JSON `json:"conflicts"`

	// Recommends is a list of modules that are recommended for this phase.
	Recommends map[string]version.JSON `json:"recommends"`

	// Requires is a list of modules that are required for this phase.
	Requires map[string]version.JSON `json:"requires"`

	// Suggests is a list of modules that are suggested for this phase.
	Suggests map[string]version.JSON `json:"suggests"`
}

type Prereqs

type Prereqs struct {
	Configure Phase `json:"configure"`
	Runtime   Phase `json:"runtime"`
	Build     Phase `json:"build"`
	Test      Phase `json:"test"`
	Develop   Phase `json:"develop"`
}

type ReleaseStatus

type ReleaseStatus int
const (
	ReleaseStatusStable ReleaseStatus = iota
	ReleaseStatusTesting
	ReleaseStatusUnstable
)

func NewReleaseStatus

func NewReleaseStatus(str string) (ReleaseStatus, error)

func (*ReleaseStatus) MarshalJSON

func (r *ReleaseStatus) MarshalJSON() ([]byte, error)

func (*ReleaseStatus) String

func (r *ReleaseStatus) String() string

func (*ReleaseStatus) UnmarshalJSON

func (r *ReleaseStatus) UnmarshalJSON(data []byte) error

type Resources

type Resources struct {
	// License is a list of URLs to the license for the distribution.
	License []string `json:"license"`

	// Homepage is a URL to the homepage for the distribution.
	Homepage string `json:"homepage"`

	// BugTracker contains information about the bug tracker for the
	// distribution.
	BugTracker struct {
		// Web is a URL to the web interface for the bug tracker.
		Web string `json:"web"`

		// Mailto is an email address to which bug reports should be
		// sent.
		MailTo string `json:"mailto"`
	} `json:"bugtracker"`

	// Repository is a URL to the repository for the distribution.
	Repository struct {
		// Type is the type of repository.
		Type string `json:"type"`

		// URL is the URL of the repository.
		URL string `json:"url"`

		// Web is a URL to the web interface for the repository.
		Web string `json:"web"`
	}
}

type Spec

type Spec struct {
	// Author is a list of the distribution's authors/maintainers.
	//
	// This takes the form of a list of strings in the form "NAME <EMAIL>".
	Author []string `json:"author"`

	// DynamicConfig is a boolean indicating whether the distribution
	// requires dynamic configuration through a Build.PL or Makefile.PL
	// script.
	DynamicConfig bool `json:"dynamic_config"`

	// GeneratedBy is the name of the program that generated the META.json
	// file.
	//
	// It takes the form of "NAME version VERSION"
	GeneratedBy string `json:"generated_by"`

	// License is a list of the distribution's licenses
	License []License `json:"license"`

	// MetaSpec is the version of the META spec that the META.json or
	// META.yml file conforms to.
	MetaSpec APIVersion `json:"meta-spec"`

	// Name is the name of the distribution.
	Name string `json:"name"`

	// ReleaseStatus is the release status of the distribution.
	ReleaseStatus ReleaseStatus `json:"release_status"`

	// Version is the version of the distribution.
	Version version.JSON `json:"version"`

	// Description is a short description of the distribution.
	Description string `json:"description"`

	// Keywords is a list of keywords that describe the distribution.
	Keywords []string `json:"keywords"`

	// NoIndex contains lists of directories and files that should not be
	// indexed by CPAN clients.
	NoIndex NoIndex `json:"no_index"`

	// OptionalFeatures is a map of optional features that the
	// distribution provides.
	OptionalFeatures map[string]OptionalFeature `json:"optional_features"`

	// Prereqs contains the prerequisites for the distribution.
	Prereqs Prereqs `json:"prereqs"`

	// Provides is a map of files that the distribution provides.
	Provides map[string]File `json:"provides"`

	// Resources contains info on resources related to the distribution.
	Resources Resources `json:"resources"`
}

func (*Spec) UnmarshalJSON

func (s *Spec) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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