Documentation
¶
Index ¶
- Constants
- func AppendFilePath(basePath string, fileOrFolder string) string
- func AppendFilePaths(basePath string, fileOrFolders ...string) string
- func ForceDeleteFolder(foldername string, loggerEntry *logrus.Entry) (err error)
- func GetReflectTypeOfStructObject(sampleModel interface{}) reflect.Type
- func MakeDirectoryHelper(destinationFolder string, loggerEntry *logrus.Entry) (err error)
- type ErrorWithCodeData
- type LogCapturer
Constants ¶
const OSPathSeparator = string(os.PathSeparator)
OSPathSeparator versi string dari os.PathSeparator
Variables ¶
This section is empty.
Functions ¶
func AppendFilePath ¶
AppendFilePath add file/ folder ke path. esensi nya base path bisa di akhiri dengan path separator. fungsi ini memastikan kalau misal not end with path separator, akan di tambahkan path separator. kalau sudah, tinggal gabung string saja <strong>basePath: <strong> folder awal untuk di tambahkan file atau folder
func AppendFilePaths ¶
AppendFilePaths versi ini dengan path berupa array. misal nested folder
func ForceDeleteFolder ¶
ForceDeleteFolder delete folder yang tidak kosong. paksa
func GetReflectTypeOfStructObject ¶
GetReflectTypeOfStructObject read actual object type. this function will scan for actual object type when wrapped as interface{}. actual object type could be determined
Types ¶
type ErrorWithCodeData ¶
type ErrorWithCodeData interface { error //GetErrorCode read error code GetErrorCode() string //GetRawError rawerror data GetRawError() error }
ErrorWithCodeData error with code
func ErrorWithCode ¶
func ErrorWithCode(errorMessage string, errorCode string) ErrorWithCodeData
ErrorWithCode generate error with code
func ErrorWithCodeAndRawError ¶
func ErrorWithCodeAndRawError(errorMessage string, errorCode string, err error) ErrorWithCodeData
ErrorWithCodeAndRawError generate error with raw error
type LogCapturer ¶
type LogCapturer interface {
Release()
}
LogCapturer reroutes testing.T log output
func CaptureLog ¶
func CaptureLog(t *testing.T) LogCapturer
CaptureLog redirects logrus output to testing.Log