credits

package
v2.18.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package credits holds the contributor list and the third-party software notices embedded in Core. The data files are generated by scripts/credits; regenerate them with "task credits" instead of editing them by hand.

Index

Constants

View Source
const (
	ComponentsFile   = "components.json.gz"
	ContributorsFile = "contributors.json"
)

ComponentsFile and ContributorsFile are the generated data files, relative to this package's directory.

Variables

This section is empty.

Functions

func EncodeBundle

func EncodeBundle(bundle *Bundle) ([]byte, error)

EncodeBundle serializes a bundle as indented JSON compressed with gzip. The output depends only on the bundle, so regenerating unchanged data gives the same bytes.

func SortComponents

func SortComponents(components []Component)

SortComponents orders components by name, ignoring case.

Types

type Bundle

type Bundle struct {
	Texts      map[string]string `json:"texts"`
	Components []Component       `json:"components"`
}

Bundle is every third-party component with the license texts they use.

func Components

func Components() (*Bundle, error)

Components returns the embedded third-party software bundle.

func DecodeBundle

func DecodeBundle(data []byte) (*Bundle, error)

DecodeBundle reads a bundle written by EncodeBundle.

func (*Bundle) ComponentText

func (b *Bundle) ComponentText(component *Component, format func(string) string) string

ComponentText renders one component's details and full license texts as plain text. format, when not nil, rewrites each license text for display.

func (*Bundle) Notices

func (b *Bundle) Notices() string

Notices renders every component as the plain-text notices file shipped in release archives. A license text shared by several components is written out in full once and referenced after that.

type Component

type Component struct {
	Name    string        `json:"name"`
	Version string        `json:"version,omitempty"`
	URL     string        `json:"url,omitempty"`
	License string        `json:"license"`
	Note    string        `json:"note,omitempty"`
	Files   []LicenseFile `json:"files"`
}

Component is one piece of third-party software included in Core.

type Contributor

type Contributor struct {
	Name  string `json:"name"`
	Login string `json:"login"`
}

Contributor is a person credited for contributing to Zaparoo Core.

func Contributors

func Contributors() ([]Contributor, error)

Contributors returns the embedded contributor list.

type LicenseFile

type LicenseFile struct {
	Name string `json:"name"`
	Text string `json:"text"`
}

LicenseFile is one license, notice or copying file shipped with a component. Text is the key of its content in Bundle.Texts, so identical files are stored once.

Jump to

Keyboard shortcuts

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