swift

package
v1.20.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PropertyScope         = "swift.scope"
	PropertyName          = "swift.name"
	PropertyRepositoryURL = "swift.repository_url"
)

Variables

View Source
var (
	ErrMissingManifestFile    = util.NewInvalidArgumentErrorf("Package.swift file is missing")
	ErrManifestFileTooLarge   = util.NewInvalidArgumentErrorf("Package.swift file is too large")
	ErrInvalidManifestVersion = util.NewInvalidArgumentErrorf("manifest version is invalid")
)

Functions

func TrimmedVersionString

func TrimmedVersionString(v *version.Version) string

TrimmedVersionString returns the version string without the patch segment if it is zero

Types

type Manifest

type Manifest struct {
	Content      string `json:"content"`
	ToolsVersion string `json:"tools_version,omitempty"`
}

Manifest represents a Package.swift file

type Metadata

type Metadata struct {
	Description   string               `json:"description,omitempty"`
	Keywords      []string             `json:"keywords,omitempty"`
	RepositoryURL string               `json:"repository_url,omitempty"`
	License       string               `json:"license,omitempty"`
	Author        Person               `json:"author,omitempty"`
	Manifests     map[string]*Manifest `json:"manifests,omitempty"`
}

Metadata represents the metadata of a Swift package

type Package

type Package struct {
	RepositoryURLs []string
	Metadata       *Metadata
}

Package represents a Swift package

func ParsePackage

func ParsePackage(sr io.ReaderAt, size int64, mr io.Reader) (*Package, error)

ParsePackage parses the Swift package upload

type Person

type Person struct {
	Type       string `json:"@type,omitempty"`
	GivenName  string `json:"givenName,omitempty"`
	MiddleName string `json:"middleName,omitempty"`
	FamilyName string `json:"familyName,omitempty"`
}

https://schema.org/Person

func (Person) String

func (p Person) String() string

type ProgrammingLanguage

type ProgrammingLanguage struct {
	Type string `json:"@type"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

https://schema.org/ProgrammingLanguage

type SoftwareSourceCode

type SoftwareSourceCode struct {
	Context             []string            `json:"@context"`
	Type                string              `json:"@type"`
	Name                string              `json:"name"`
	Version             string              `json:"version"`
	Description         string              `json:"description,omitempty"`
	Keywords            []string            `json:"keywords,omitempty"`
	CodeRepository      string              `json:"codeRepository,omitempty"`
	License             string              `json:"license,omitempty"`
	Author              Person              `json:"author"`
	ProgrammingLanguage ProgrammingLanguage `json:"programmingLanguage"`
	RepositoryURLs      []string            `json:"repositoryURLs,omitempty"`
}

https://schema.org/SoftwareSourceCode

Jump to

Keyboard shortcuts

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