filex

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NL     = "\n"
	XmdDir = ".Xmd"
)

NL defines a new line.

Variables

View Source
var XmdHome string

Functions

func Clean

func Clean(category string) error

Clean deletes all templates and removes the parent directory.

func Copy

func Copy(src, dest string) error

func CreateTemplate

func CreateTemplate(category, name, content string) error

CreateTemplate writes template into file even it is exists.

func FileExists

func FileExists(file string) bool

FileExists returns true if the specified file is exists.

func GetCacheDir

func GetCacheDir() (string, error)

GetCacheDir returns the cache dit of Xmd.

func GetDefaultXmdHome

func GetDefaultXmdHome() (string, error)

GetDefaultXmdHome returns the path value of the Xmd home where Join $HOME with .Xmd.

func GetTemplateDir

func GetTemplateDir(category string) (string, error)

GetTemplateDir returns the category path value in XmdHome where could get it by GetXmdHome.

func GetXmdHome

func GetXmdHome() (home string, err error)

GetXmdHome returns the path value of the Xmd, the default path is ~/.Xmd, if the path has been set by calling the RegisterXmdHome method, the user-defined path refers to.

func InitTemplates

func InitTemplates(category string, templates map[string]string) error

InitTemplates creates template files XmdHome where could get it by GetXmdHome.

func LoadTemplate

func LoadTemplate(category, file, builtin string) (string, error)

LoadTemplate gets template content by the specified file.

func LookPath

func LookPath(xBin string) (string, error)

LookPath searches for an executable named file in the directories named by the PATH environment variable, for the os windows, the named file will be spliced with the .exe suffix.

func LookUpProtoc

func LookUpProtoc() (string, error)

LookUpProtoc searches an executable protoc in the directories named by the PATH environment variable.

func LookUpProtocGenGo

func LookUpProtocGenGo() (string, error)

LookUpProtocGenGo searches an executable protoc-gen-go in the directories named by the PATH environment variable.

func LookUpProtocGenGoGrpc

func LookUpProtocGenGoGrpc() (string, error)

LookUpProtocGenGoGrpc searches an executable protoc-gen-go-grpc in the directories named by the PATH environment variable.

func MkdirIfNotExist

func MkdirIfNotExist(dir string) error

MkdirIfNotExist makes directories if the input path is not exists

func ReadLink(name string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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