config

package
v1.1.1-0...-acba925 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	PathTemplateConf string     `yaml:"-"`
	PathUserConf     string     `yaml:"-"` // Path to configuration file
	Stderr           io.Writer  `yaml:"-"`
	MasterURLs       []string   `yaml:"masters,omitempty"` // URLs to master git repositories
	Templates        []Template `yaml:"-"`                 // Template definitions
}

File configuration as loaded from the configuration file

func (*File) AppendTemplate

func (f *File) AppendTemplate(t Template) (err error)

AppendTemplate appends a template to list of templates. If stop is non zero, the calling function should exit the program with the value contained in stop.

func (*File) Load

func (f *File) Load() error

Load loads configuration file from disk

func (*File) SaveTemplates

func (f *File) SaveTemplates() error

SaveTemplates saves template configuration file to disk

type SortByName

type SortByName []Template

SortByName sort template alphabetically by name

func (SortByName) Len

func (a SortByName) Len() int

func (SortByName) Less

func (a SortByName) Less(i, j int) bool

func (SortByName) Swap

func (a SortByName) Swap(i, j int)

type Template

type Template struct {
	Handle   string `yaml:"handle"`
	Template string `yaml:"template"`
	Origin   string `yaml:"origin"`
	URL      string `yaml:"url"`
	Desc     string `yaml:"desc"`
}

Template template configuration in main configuration file

Jump to

Keyboard shortcuts

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