snippet

package
v0.0.0-...-332fa53 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsMissingKeys

func IsMissingKeys(err error) ([]string, bool)

IsMissingKeys reports whether an "err" is caused by template missing keys.

Types

type File

type File struct {
	// Remote, should be filled if direct.
	Repo string `json:"-"`
	// Remote, fetched at `ListFiles`.
	Name        string `json:"name"`
	Type        string `json:"type"`
	DownloadURL string `json:"download_url"`
	Version     string `json:"-"`
	// Local.
	Dest         string                 `json:"-"` // The destination path, including the filename (if does not contain a filename the "Name" will be used instead.)
	Package      string                 `json:"-"` // The go package declaration.
	Data         map[string]interface{} `json:"-"` // Any template data.
	Replacements map[string]string      `json:"-"` // Any replacements.
}

File represents a github file to be locally saved. See `ListFiles` package-level function too.

func ListFiles

func ListFiles(repo, version string) ([]*File, error)

ListFiles returns a github repository's files.

func (*File) Install

func (f *File) Install() error

Install downloads and performs necessary tasks to save a remote file.

Jump to

Keyboard shortcuts

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