catalog

package module
v0.0.0-...-5587f24 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: GPL-3.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Catalog

type Catalog struct {
	// contains filtered or unexported fields
}

Catalog is collected information about

func Load

func Load(r io.Reader) (*Catalog, error)

Load loads an existing catalog in json form from the given reader

func New

func New(name string) *Catalog

New creates a new empty catalog

func (*Catalog) Entries

func (c *Catalog) Entries() []Entry

Entries returns all the entries in the catalog

func (*Catalog) Get

func (c *Catalog) Get(name string) *Entry

Get returns the first matching entry found in the catalog or nil

func (*Catalog) Insert

func (c *Catalog) Insert(entry *Entry)

Insert places the given entry in the catalog potentially replacing an entry with the name name

func (*Catalog) Name

func (c *Catalog) Name() string

Name returns the name of the catalog

func (*Catalog) Store

func (c *Catalog) Store(w io.Writer) error

Store writes the catalog in json form to the given writer

func (*Catalog) Updated

func (c *Catalog) Updated() time.Time

Updated returns the update time for catalog

type Entry

type Entry struct {
	ProjectName   string   `json:"project_name"`
	URL           string   `json:"project_url,omitempty"`
	Author        string   `json:"author,omitempty"`
	Homepage      string   `json:"home_page,omitempty"`
	Description   string   `json:"description"`
	Discussion    string   `json:"discussion_url,omitempty"`
	Documentation string   `json:"documentation_url,omitempty"`
	Tags          []string `json:"tags,omitempty"`
	Version       string   `json:"version,omitempty"`
	Origin        string   `json:"origin,omitempty"`
}

Entry contains the properties of a project which are recorded as part of the catalog

type Header struct {
	Version int    `json:"version"`
	Kind    string `json:"kind"`
}

Header describes the file type and schema version for compatibility purposes

type Source

type Source struct {
	Name string `json:"name"`
	// Destination string            `json:"destination"`
	Method     string            `json:"method"`
	Parameters map[string]string `json:"parameters"`
}

Source describes how to retrieve a catalog with the given name

type SourceFile

type SourceFile struct {
	// contains filtered or unexported fields
}

SourceFile is collected information about

func LoadSource

func LoadSource(r io.Reader) (*SourceFile, error)

LoadSource loads an existing catalog source description in json form from the given reader

func NewSourceFile

func NewSourceFile(name, destination, method string) *SourceFile

NewSourceFile creates a new empty source description file

func (*SourceFile) Source

func (s *SourceFile) Source() *Source

Source returns the source details

func (*SourceFile) StoreSource

func (s *SourceFile) StoreSource(w io.Writer) error

StoreSource writes the catalog in json form to the given writer

Jump to

Keyboard shortcuts

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