utils

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2020 License: MIT, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Utils

type Utils struct{}

Utils ...

func UtilsHandler

func UtilsHandler() *Utils

UtilsHandler ...

func (*Utils) CheckEnvironment

func (util *Utils) CheckEnvironment(path string) string

CheckEnvironment function check default env @path : string return bool, error

func (*Utils) CheckFile

func (util *Utils) CheckFile(path string) bool

CheckFile function check folder @path : string return error

func (*Utils) CheckTemplateFile

func (util *Utils) CheckTemplateFile(path string) (string, error)

CheckTemplateFile check template path @argsFile: string

func (*Utils) ConvertUnixTime

func (util *Utils) ConvertUnixTime(unixTime int64) time.Time

ConvertUnixTime ... @unixTime: int64

func (*Utils) CreateFile

func (util *Utils) CreateFile(path string) bool

CreateFile function create file @path : string return bool

func (*Utils) DeleteFile

func (util *Utils) DeleteFile(path string) bool

DeleteFile Function

func (*Utils) FileRemove

func (util *Utils) FileRemove(path string) error

FileRemove Remove Files @path : string return error

func (*Utils) GetCurrentPath

func (util *Utils) GetCurrentPath() string

GetCurrentPath get current path return string

func (*Utils) MakeDirs

func (util *Utils) MakeDirs(path string) error

MakeDirs fucntion create directory @path : string return error

func (*Utils) ParseJSON

func (util *Utils) ParseJSON(data string) (map[string]interface{}, error)

ParseJSON function conver json string to object @data: string return map[string]interface{}, error

func (*Utils) ParseYAML

func (util *Utils) ParseYAML(path string) (*entity.TemplatesModels, error)

ParseYAML ...

func (*Utils) ReadFile

func (util *Utils) ReadFile(path string, perm os.FileMode) string

ReadFile function

func (*Utils) ReadHome

func (util *Utils) ReadHome() string

ReadHome function return string

func (*Utils) WriteFile

func (util *Utils) WriteFile(path string, value string, perm os.FileMode) bool

WriteFile func write local file

type UtilsInterface

type UtilsInterface interface {
	ConvertUnixTime(unixTime int64) time.Time

	CheckFile(path string) bool
	MakeDirs(path string) error
	FileRemove(path string) error
	CreateFile(path string) bool
	WriteFile(path string, value string, perm os.FileMode) bool
	ReadFile(path string, perm os.FileMode) string
	DeleteFile(path string) bool
	ReadHome() string
	GetCurrentPath() string

	CheckEnvironment(path string) string
	ParseJSON(data string) (map[string]interface{}, error)
	CheckTemplateFile(path string) (string, error)
}

UtilsInterface ..

Jump to

Keyboard shortcuts

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