publiccode

package module
v0.0.0-...-ca7ba0b Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2018 License: EUPL-1.2 Imports: 20 Imported by: 0

README

publiccode.yml Go parser

A Go parser for publiccode.yml files

Features

  • Parse and validate a standard international publiccode.yml with italian extension

  • Check ISO 3166-1 alpha-2 and alpha-3 country code

  • Validate emails, URLs (http scheme, valid status code), local and remote files, dates as "YYYY-MM-DD", images (colors, mimes)

  • Check pa-types

  • Validate oembed video links

  • Validate SPDX licenses. Without WITH keyword.

  • Check tags

  • And more, as described in publiccode.yml standard.

Assets

  • amministrazioni.txt updated on: 12/07/2018.
  • oembed_providers.json updated on: 12/07/2018.

In order to update the assets, run this command:

go-bindata -o assets.go data/

And change the package name into publiccode

Contributing

Contributing is always appreciated.

Feel free to open issues, fork and submit a Pull Request.

If you want to know more, like "add a new field", check out CONTRIBUTING.md

License

© 2018 Presidenza del consiglio dei Minstri – Licensed under the EUPL The version control system provides attribution for specific lines of code.

Documentation

Overview

Code generated by go-bindata. DO NOT EDIT. sources: data/amministrazioni.txt data/oembed_providers.json

Index

Constants

View Source
const Version = "http://w3id.org/publiccode/version/0.1"

Version of the PublicCode specs. Source https://github.com/publiccodenet/publiccode.yml

Variables

View Source
var BaseDir = ""

BaseDir is the RAW Base Directory of the PublicCode file. If local will be empty: "" If remote will be the url of the RAW repository (eg: https://raw.githubusercontent.com/gith002/Medusa/master)

Lock uses sync.Mutex lock/unlock for goroutines.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func Parse

func Parse(in []byte, pc *PublicCode) error

Parse loads the yaml bytes and tries to parse it. Return an error if fails.

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

Types

type Amministrazione

type Amministrazione struct {
	CodAmm            string
	DesAmm            string
	Comune            string
	NomeResp          string
	CognResp          string
	Cap               string
	Provincia         string
	Regione           string
	SitoIstituzionale string
	Indirizzo         string
	TitoloResp        string
	TipologiaIstat    string
	TipologiaAmm      string
	Acronimo          string
	CFValidato        string
	CF                string
	Mail1             string
	TipoMail1         string
	Mail2             string
	TipoMail2         string
	Mail3             string
	TipoMail3         string
	Mail4             string
	TipoMail4         string
	Mail5             string
	TipoMail5         string
	URLFacebook       string
	URLTwitter        string
	URLGoogleplus     string
	URLYoutube        string
	LivAccessibili    string
}

Amministrazione is an Administration from amministrazoni.txt Retrieved from: http://www.indicepa.gov.it/documentale/n-opendata.php

type Contact

type Contact struct {
	Name        string `yaml:"name"`
	Email       string `yaml:"email"`
	Affiliation string `yaml:"affiliation"`
	Phone       string `yaml:"phone"`
}

Contact is a contact info maintaining the software. Reference: https://github.com/publiccodenet/publiccode.yml/blob/develop/schema.md#contact

type Contractor

type Contractor struct {
	Name    string    `yaml:"name"`
	Website *url.URL  `yaml:"website"`
	Until   time.Time `yaml:"until"`
}

Contractor is an entity or entities, if any, that are currently contracted for maintaining the software. Reference: https://github.com/publiccodenet/publiccode.yml/blob/develop/schema.md#contractor

type Dependency

type Dependency struct {
	Name       string `yaml:"name"`
	VersionMin string `yaml:"versionMin"`
	VersionMax string `yaml:"versionMax"`
	Optional   bool   `yaml:"optional"`
	Version    string `yaml:"version"`
}

Dependency describe system-level dependencies required to install and use this software. Reference: https://github.com/publiccodenet/publiccode.yml/blob/develop/schema.md#section-dependencies

type Desc

type Desc struct {
	LocalisedName    string     `yaml:"localisedName"`
	GenericName      string     `yaml:"genericName"`
	ShortDescription string     `yaml:"shortDescription"`
	LongDescription  string     `yaml:"longDescription"`
	Documentation    *url.URL   `yaml:"documentation"`
	APIDocumentation *url.URL   `yaml:"apiDocumentation"`
	FeatureList      []string   `yaml:"featureList"`
	Screenshots      []string   `yaml:"screenshots"`
	Videos           []*url.URL `yaml:"videos"`
	Awards           []string   `yaml:"awards"`
	FreeTags         []string   `yaml:"freeTags"`
}

Desc is a general description of the software. Reference: https://github.com/publiccodenet/publiccode.yml/blob/develop/schema.md#section-description

type ErrorInvalidKey

type ErrorInvalidKey struct {
	Key string
}

func (ErrorInvalidKey) Error

func (e ErrorInvalidKey) Error() string

type ErrorInvalidValue

type ErrorInvalidValue struct {
	Key    string
	Reason string
}

func (ErrorInvalidValue) Error

func (e ErrorInvalidValue) Error() string

type ErrorParseMulti

type ErrorParseMulti []error

func (ErrorParseMulti) Error

func (es ErrorParseMulti) Error() string

type ExtensionIT

type ExtensionIT struct {
	Conforme struct {
		Accessibile    bool `yaml:"accessibile"`
		Interoperabile bool `yaml:"interoperabile"`
		Sicuro         bool `yaml:"sicuro"`
		Privacy        bool `yaml:"privacy"`
	} `yaml:"conforme"`

	Riuso struct {
		CodiceIPA string `yaml:"codiceIPA"`
	} `yaml:"riuso"`

	Spid   bool `yaml:"spid"`
	Pagopa bool `yaml:"pagopa"`
	Cie    bool `yaml:"cie"`
	Anpr   bool `yaml:"anpr"`

	Ecosistemi []string `yaml:"ecosistemi"`

	DesignKit struct {
		Seo     bool `yaml:"seo"`
		UI      bool `yaml:"ui"`
		Web     bool `yaml:"web"`
		Content bool `yaml:"content"`
	} `yaml:"designKit"`
}

ExtensionIT is the country-specific extension for Italy. Reference: https://github.com/publiccodenet/publiccode.yml/blob/develop/schema.it.md

type PublicCode

type PublicCode struct {
	PubliccodeYamlVersion string `yaml:"publiccode-yaml-version"`

	Name             string   `yaml:"name"`
	ApplicationSuite string   `yaml:"applicationSuite"`
	URL              *url.URL `yaml:"url"`
	LandingURL       *url.URL `yaml:"landingURL"`

	IsBasedOn       []string  `yaml:"isBasedOn"`
	SoftwareVersion string    `yaml:"softwareVersion"`
	ReleaseDate     time.Time `yaml:"releaseDate"`

	InputTypes  []string `yaml:"inputTypes"`
	OutputTypes []string `yaml:"outputTypes"`

	Platforms []string `yaml:"platforms"`

	Tags []string `yaml:"tags"`

	UsedBy []string `yaml:"usedBy"`

	Roadmap *url.URL `yaml:"roadmap"`

	DevelopmentStatus string `yaml:"developmentStatus"`

	SoftwareType string `yaml:"softwareType"`

	IntendedAudience struct {
		OnlyFor              []string `yaml:"onlyFor"`
		Countries            []string `yaml:"countries"`
		UnsupportedCountries []string `yaml:"unsupportedCountries"`
	} `yaml:"intendedAudience"`

	Description map[string]Desc `yaml:"description"`

	Legal struct {
		License            string `yaml:"license"`
		MainCopyrightOwner string `yaml:"mainCopyrightOwner"`
		RepoOwner          string `yaml:"repoOwner"`
		AuthorsFile        string `yaml:"authorsFile"`
	} `yaml:"legal"`

	Maintenance struct {
		Type        string       `yaml:"type"`
		Contractors []Contractor `yaml:"contractors"`
		Contacts    []Contact    `yaml:"contacts"`
	} `yaml:"maintenance"`

	Localisation struct {
		LocalisationReady  bool     `yaml:"localisationReady"`
		AvailableLanguages []string `yaml:"availableLanguages"`
	} `yaml:"localisation"`

	DependsOn struct {
		Open        []Dependency `yaml:"open"`
		Proprietary []Dependency `yaml:"proprietary"`
		Hardware    []Dependency `yaml:"hardware"`
	} `yaml:"dependsOn"`

	It ExtensionIT `yaml:"it"`
}

Publiccode is a publiccode.yml file definition. Reference: https://github.com/publiccodenet/publiccode.yml

Jump to

Keyboard shortcuts

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