common

package
v0.0.0-...-4518a5d Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const OSPathSeparator = string(os.PathSeparator)

OSPathSeparator versi string dari os.PathSeparator

Variables

This section is empty.

Functions

func AppendFilePath

func AppendFilePath(basePath string, fileOrFolder string) string

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

func AppendFilePaths(basePath string, fileOrFolders ...string) string

AppendFilePaths versi ini dengan path berupa array. misal nested folder

func ForceDeleteFolder

func ForceDeleteFolder(foldername string, loggerEntry *logrus.Entry) (err error)

ForceDeleteFolder delete folder yang tidak kosong. paksa

func GetReflectTypeOfStructObject

func GetReflectTypeOfStructObject(sampleModel interface{}) reflect.Type

GetReflectTypeOfStructObject read actual object type. this function will scan for actual object type when wrapped as interface{}. actual object type could be determined

func MakeDirectoryHelper

func MakeDirectoryHelper(destinationFolder string, loggerEntry *logrus.Entry) (err error)

MakeDirectoryHelper helper membuat directory. kalau directory tidak ada. ini tidak menyertakan pembuatan kalau directory nested

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

type SimpleUserData

type SimpleUserData struct {
	//ID internal id of user. if primary key is int32
	ID int32
	//UUID uuid dari user
	UUID string
	//Username username. ini berisi sama dengan UserUUID kalau misal anonymous
	Username string
	//RealName dari column real_name
	RealName string
	//Email dari column: email
	Email string
	//UserUUID dari column uuid
	UserUUID string
	//Phone kalau user dengan phone auth , ini akan di ambil dari phone1
	Phone string
}

SimpleUserData simple user data

Jump to

Keyboard shortcuts

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