cmd

package
v1.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2022 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CatalogUpdateRun

func CatalogUpdateRun(args []string)

CatalogUpdateRun updates the specified catalogs based on their source configuration

func CheckErrorFatal

func CheckErrorFatal(e error)

CheckErrorFatal logs a fatal error if error value is non-nil

func CheckErrorNonFatal

func CheckErrorNonFatal(e error, ok string) bool

CheckErrorNonFatal logs the error if error value is non-nil, returning true if there was an error

func ConfigureLogger

func ConfigureLogger()

ConfigureLogger tweaks the configuration of the global logger based on parsed command line flags

func DownloadCatalog

func DownloadCatalog(source *catalog.Source, outputPath string)

DownloadCatalog downloads the catalog from the location given in the source and writes it to the given path

func Execute

func Execute()

Execute add all child commands to the root command and defaults flags appropriately (called from main.main())

func GenerateCatalogFromLines

func GenerateCatalogFromLines(source *catalog.Source, outputPath string)

GenerateCatalogFromLines constructs a new catalog by gathering project information from lines and writes it to the given path

func GetCatalogPaths

func GetCatalogPaths() []string

GetCatalogPaths returns paths to all files matching the catalog search pattern(s)

func GetPathsForPatterns

func GetPathsForPatterns(pathPatterns []string) []string

GetPathsForPatterns returns the paths to any file matching the file path(s)

func GetSourcePaths

func GetSourcePaths() []string

GetSourcePaths returns paths to all files matching the catalog source search pattern(s)

func LoadConfiguration

func LoadConfiguration()

LoadConfiguration attempts to load in external configuration if possible, this function must be called in each commands execute function (after argument processing) because its behavior is influenced by the command line itself

func SearchCatalogs

func SearchCatalogs(catalogs []*LoadedCatalog, projectName string) *catalog.Entry

SearchCatalogs looks for an Entry which matches the given name

func Version added in v1.1.4

func Version() string

Version constructs the formatted version string.

Types

type LoadedCatalog

type LoadedCatalog struct {
	Catalog  *catalog.Catalog
	FileInfo os.FileInfo
	Path     string
}

LoadedCatalog contains the parsed contents of a catalog file along with its path and stat info

func LoadCatalogFile

func LoadCatalogFile(path string) (*LoadedCatalog, error)

LoadCatalogFile reads in the catalog for the given path

func LoadCatalogs

func LoadCatalogs() []*LoadedCatalog

LoadCatalogs loads all catalogs specified in the config

type LoadedSource

type LoadedSource struct {
	Source   *catalog.Source
	FileInfo os.FileInfo
	Path     string
}

LoadedSource contains the parsed contents of a catalog source config file along with its path and stat info

func LoadSourceFile

func LoadSourceFile(path string) (*LoadedSource, error)

LoadSourceFile reads in a catalog source config from the given file path

func LoadSources

func LoadSources() []*LoadedSource

LoadSources loads in all catalog sources specified in the config

type TextFormatter

type TextFormatter struct {
}

TextFormatter defines a trivial log entry formatter

func (*TextFormatter) Format

func (f *TextFormatter) Format(entry *logrus.Entry) ([]byte, error)

Format performs basic formatting on log entries

Jump to

Keyboard shortcuts

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