registry

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = semver.MustParse("1.0.0")

Version is the registry file version

Functions

This section is empty.

Types

type Github

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

func NewGithubClient

func NewGithubClient(key string) *Github

func (*Github) Get

func (g *Github) Get(link string) (*Plugin, error)

Get uses a link to a repo, and extracts all the info necessary to add a plugin to the registry. It also validates several properties of the repository, such as a valid license, not archived, and that it includes the "heedy" topic

type Plugin

type Plugin struct {
	Name        string
	Icon        string
	FullName    string
	Description string
	Version     semver.Version

	Webpage    string
	ReleaseURL string
	Python     bool
	License    string
	Stars      int
	Timestamp  time.Time
	// contains filtered or unexported fields
}

Plugin holds info about the plugin from the registry

type Registry

type Registry struct {
	RegistryVersion semver.Version
	Updated         time.Time
	// contains filtered or unexported fields
}

Registry holds info about the... registry!

func Create

func Create(filename string) (*Registry, error)

Create generates a new regsitry database file

func Open

func Open(filename string) (*Registry, error)

Open opens a registry file

func (*Registry) Close

func (r *Registry) Close() error

Close closes the underlying database

func (*Registry) Get

func (r *Registry) Get(key string) (string, error)

Get gets the given key. If none is set, returns empty string

func (*Registry) Set

func (r *Registry) Set(key string, value string) error

Set sets the given key

func (*Registry) UpdateRegistry

func (r *Registry) UpdateRegistry() (time.Time, error)

UpdateRegistry updates the registry timestamp

Jump to

Keyboard shortcuts

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