util

package
v0.0.0-...-d9ff819 Latest Latest
Warning

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

Go to latest
Published: May 18, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildRegexFilterByExtension

func BuildRegexFilterByExtension(arguments ...string) *regexp.Regexp

func CheckDirectory

func CheckDirectory(directory string, closeOnFailure bool) error

func ContainTypeInList

func ContainTypeInList[T any](value T, list *[]T) bool

func GetFileContent

func GetFileContent(absPath string) []string

func GetFiles

func GetFiles(directory string, libRegEx *regexp.Regexp) *[]FileWrapper

func WriteFile

func WriteFile(lines []string, title string)

Types

type DefaultFileWrapper

type DefaultFileWrapper struct {
	FileContent []string
	FileInfo    fs.FileInfo
	Path        string
	Extension   string
}

func (*DefaultFileWrapper) GetExtension

func (w *DefaultFileWrapper) GetExtension() string

func (*DefaultFileWrapper) GetFileContent

func (w *DefaultFileWrapper) GetFileContent() []string

func (*DefaultFileWrapper) GetFileInfo

func (w *DefaultFileWrapper) GetFileInfo() fs.FileInfo

func (*DefaultFileWrapper) GetPath

func (w *DefaultFileWrapper) GetPath() string

type FileWrapper

type FileWrapper interface {
	GetFileContent() []string
	GetFileInfo() fs.FileInfo
	GetPath() string
	GetExtension() string
}

Jump to

Keyboard shortcuts

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