repositories

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {

	// Ignore defines regular expressions for the files to ignore.
	Ignore []string `yaml:"ignore"`

	// Scripts defines custom scripts for the templates.
	Scripts map[string]string `yaml:"scripts"`

	// Variable defines the variables required by the templates.
	Variables []Variable `yaml:"variables"`
}

Configuration represents the configuration for a repository.

type File

type File struct {

	// Bytes defines the content of the file.
	Bytes []byte

	// Info defines the info of the file.
	Info os.FileInfo

	// Path defines the relative path of the file.
	Path string
}

File represents a file from a repository.

type Repository

type Repository struct {

	// Scripts defines the scripts for the repository.
	Scripts map[string]string

	// Variables defines the variables for the repository.
	Variables []Variable
	// contains filtered or unexported fields
}

Repository represents a template repository.

func Open

func Open(repositoryURL string, configurationFile string) (*Repository, error)

Open returns a repository ready for processing.

func (*Repository) Close

func (r *Repository) Close() error

Close frees up all resources associated within the repository.

func (*Repository) Render

func (r *Repository) Render(destination string, context *templates.Context) error

Render renders the templates from this repository to disk.

type Variable

type Variable struct {

	// Name defines the name of the variable.
	Name string `yaml:"name"`

	// Description defines the description the variable.
	Description string `yaml:"description"`

	// Value defines the value of the variable.
	Value string `yaml:"value"`

	// Pattern defines a regex pattern for valid values.
	Pattern string `yaml:"pattern"`
}

Variable represents a variable for substitution in a template.

Jump to

Keyboard shortcuts

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