pkg

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const BUONOTTI_ENDPOINT string = "https://api.github.com/orgs/buonotti/repos"

BUONOTTI_ENDPOINT is the official repo

Variables

This section is empty.

Functions

func AddRepo

func AddRepo(name string, url string, ty RepoType) error

AddRepo adds a new remote repo

func AddTemplateSource

func AddTemplateSource(lang string, url string, branch string, commit string) error

AddTemplateSource adds a language with a custom git repo to the lockfile

func Create

func Create(lang string, name string, force bool, noCache bool) error

Create creates a new validator from the given template

func DiscoverTemplates

func DiscoverTemplates(repo RepoEntry) (map[string]TemplateEntry, error)

DiscoverTemplates loads all templates from a repo

func Update

func Update(override bool) error

Update updates the lockfile with the templates found in the repos

func Upgrade

func Upgrade(name string) error

func UpgradeAll

func UpgradeAll() error

Types

type Lockfile

type Lockfile struct {
	LastUpdate util.ApisenseTime        `json:"lastUpdate"` // LastUpdate is when the last update was run
	Repos      map[string]RepoEntry     `json:"repos"`      // Repos are the remote repos to look for new templates
	Templates  map[string]TemplateEntry `json:"templates"`  // Templates are the available templates
}

type RepoEntry

type RepoEntry struct {
	Url  string   `json:"url"`
	Type RepoType `json:"type"`
}

RepoEntry holds the information of a remote template

type RepoType

type RepoType string

RepoType is the type of the remote repo

const (
	GitHub RepoType = "github" // GitHub defines the remote is a github profile/org
)

type TemplateEntry

type TemplateEntry struct {
	Repo   string `json:"repo"`
	Branch string `json:"branch"`
	Commit string `json:"commit"`
}

TemplateEntry holds the information for a single template

Jump to

Keyboard shortcuts

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