helpers

package
v0.1.1-0...-c17c15d Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2019 License: Unlicense Imports: 16 Imported by: 0

Documentation

Overview

andrzej lichnerowicz, unlicensed (~public domain)

andrzej lichnerowicz, unlicensed (~public domain)

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCouldNotCreateDirectory     = errors.New("belit/fs: could not create directory")
	ErrCouldNotCreateTemporaryFile = errors.New("belit/fs: could not create temporary file")
	ErrFileDoesNotExist            = errors.New("belit/fs: file does not exist")
	ErrCouldNotReadFile            = errors.New("belit/fs: could not read file")
)
View Source
var (
	ErrCouldNotOpenFile     = errors.New("belit/parser: could not open file for reading")
	ErrCouldNotCloseScanner = errors.New("belit/parser: could not close scanner")
)
View Source
var AppFS = afero.NewOsFs()
View Source
var (
	ErrorModelineNotFound = errors.New("modeline not found")
)

Functions

func DownloadRemote

func DownloadRemote(baseDir string, url string) error

func EnsureDirectory

func EnsureDirectory(baseDir string) error

TODO: add error return

func ExtractModelineOptions

func ExtractModelineOptions(buffer string) (map[string]string, error)

ExtractModelineOptions searches throght the file in search of vim's [modeline](http://vimdoc.sourceforge.net/htmldoc/options.html#modeline) compatibile options

func FileExists

func FileExists(name string) error

func GetFileContents

func GetFileContents(name string) ([]byte, error)

func GetTempFile

func GetTempFile() (string, error)

func PrintCommand

func PrintCommand(command []string, isDebug bool) error

func RemoveFile

func RemoveFile(name string) error

func RunCommand

func RunCommand(command []string) (string, string, error)

Types

type CompilerOptions

type CompilerOptions struct {
	CompilerEnv        string
	CompilerOptionsEnv string
}

CompilerOptions holds names of environments to look at based on file type (extension)

func GetCompilerOptions

func GetCompilerOptions(filename string) (CompilerOptions, error)

GetCompilerOptions returns set of names to corresponding options based on file type

type SourceInfo

type SourceInfo struct {
	RepositoryPath string
	HeaderName     string
}

func GetSources

func GetSources(file string) ([]SourceInfo, error)

func GetSourcesFromBuffer

func GetSourcesFromBuffer(buffer []byte) ([]SourceInfo, error)

Jump to

Keyboard shortcuts

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