Documentation
¶
Overview ¶
aes256.go Author Andrey Izman <izmanw@gmail.com> Copyright 2018 Andrey Izman License MIT
Index ¶
- func AddLogError(message string)
- func AddLogErrorWithFields(message string, param map[string]interface{})
- func AddLogInfo(message string)
- func AddLogInfoWithFields(message string, param map[string]interface{})
- func AddLogWarn(message string)
- func AddLogWarnWithFields(message string, param map[string]interface{})
- func CheckNetConnect(host string, ports []string) map[int64]bool
- func CopyFile(src, dst string) (int64, error)
- func Decrypt(encrypted string) string
- func DecryptWithKey(encrypted string, passphrase string) string
- func Encrypt(text string) string
- func EncryptWithKey(text string, passphrase string) string
- func GenUUID() string
- func GetFieldInteger(e interface{}, field string) int
- func GetFieldString(e interface{}, field string) string
- func GetIpFromDomain(domain string) string
- func GetIpOutbound() (ip string, err error)
- func InInt64Slice(val int64, slice []int64) (int, bool)
- func InStringSlice(val string, slice []string) (int, bool)
- func IsFloat(s string) bool
- func IsInteger(s string) bool
- func IsLetterOrSpace(s string) bool
- func IsStringJSON(str string) bool
- func LoggerInit()
- func MD5(s string) string
- func RemoveDirectory(dir string) error
- func SendMail(param map[string]interface{}) error
- func SliceExists(slice interface{}, item interface{}) bool
- func ToDate(s string) time.Time
- func ToFloat64(s string, default_value float64) float64
- func ToInt64(s string, default_value int64) int64
- func Unrar(src, dest string) error
- func Unzip(src, dest string) error
- func VarDump(data interface{})
- func VarDumpToString(data interface{}) string
- func Var_dump(expression ...interface{})
- type App
- type CSVClientReaderOption
- type CsvWriterOption
- type DBClient
- func (d *DBClient) Backup(filename string) (string, error)
- func (d *DBClient) BulkImport(filename string, destination_table string, row_data_at int64) (string, error)
- func (d *DBClient) DbToCsv(sql string, opt ...CsvWriterOption) (string, error)
- func (d *DBClient) DbToExcel(sql string, opt ...ExcelClientWriterOption) (string, error)
- func (d *DBClient) GetColumns(dbName string, tableName string) ([]*DbColumnInfo, error)
- func (d *DBClient) GetData(asSQL string) (string, error)
- func (d *DBClient) GetDatabases() ([]string, error)
- func (d *DBClient) GetTables() ([]*DbTableInfo, error)
- func (d *DBClient) Paging(asSQL string, aiPage int64, aiPageSize int64) (DataPaging, error)
- func (d *DBClient) Query(asSQL string) ([]map[string]string, error)
- func (d *DBClient) Restore(filename string) (string, error)
- func (d *DBClient) TaskAbort(id string) (string, error)
- func (d *DBClient) TaskList() (map[string]interface{}, error)
- func (d *DBClient) TaskStatus(id string) (map[string]string, error)
- type DataPaging
- type DbClient
- func (d *DbClient) Close() error
- func (d *DbClient) Connect() error
- func (d *DbClient) DbfToChar(as_input string) string
- func (d *DbClient) DbfToLongChar(as_input string) string
- func (d *DbClient) Delete(table string, criteria map[string]interface{}) (sql.Result, error)
- func (d *DbClient) Exec(sql string, args ...any) (sql.Result, error)
- func (d *DbClient) ExecAsync(ctx context.Context, sql string, args ...any) string
- func (d *DbClient) ExecContext(ctx context.Context, sql string, args ...any) (sql.Result, error)
- func (d *DbClient) FindAll(sql string, args ...any) ([]map[string]interface{}, []*DbColumnInfo, error)
- func (d *DbClient) FindAllContext(ctx context.Context, sql string, args ...any) ([]map[string]interface{}, []*DbColumnInfo, error)
- func (d *DbClient) FindAllString(sql string, args ...any) ([]map[string]string, []*DbColumnInfo, error)
- func (d *DbClient) FindAllStringContext(ctx context.Context, sql string, args ...any) ([]map[string]string, []*DbColumnInfo, error)
- func (d *DbClient) FirstRow(sql string, args ...any) (map[string]interface{}, []*DbColumnInfo, error)
- func (d *DbClient) FirstRowContext(ctx context.Context, sql string, args ...any) (map[string]interface{}, []*DbColumnInfo, error)
- func (d *DbClient) FirstRowString(sql string, args ...any) (map[string]string, []*DbColumnInfo, error)
- func (d *DbClient) FirstRowStringtContext(ctx context.Context, sql string, args ...any) (map[string]string, []*DbColumnInfo, error)
- func (d *DbClient) FirstValue(sql string, args ...any) (interface{}, error)
- func (d *DbClient) FirstValueContext(ctx context.Context, sql string, args ...any) (interface{}, error)
- func (d *DbClient) FirstValueString(sql string, args ...any) (string, error)
- func (d *DbClient) FirstValueStringContext(ctx context.Context, sql string, args ...any) (string, error)
- func (d *DbClient) GetColumns(databaseName string, schemaName string, tableName string) ([]*DbColumnInfo, error)
- func (d *DbClient) GetConfig() DbClientOption
- func (d *DbClient) GetDatabases(filter ...string) ([]*DbDatabaseInfo, error)
- func (d *DbClient) GetSchemas(databaseName ...string) ([]*DbSchemaInfo, error)
- func (d *DbClient) GetTables(databaseName ...string) ([]*DbTableInfo, error)
- func (d *DbClient) GetViews(databaseName ...string) ([]*DbViewInfo, error)
- func (d *DbClient) GetWhere(table string, condition string, param ...interface{}) (map[string]string, error)
- func (d *DbClient) Insert(table string, data map[string]interface{}, suffixQueryArgs ...string) (int64, error)
- func (d *DbClient) Paging(aiPage int64, aiPageSize int64, sql string, args ...any) (*DataPaging, error)
- func (d *DbClient) PagingContext(ctx context.Context, aiPage int64, aiPageSize int64, sql string, args ...any) (*DataPaging, error)
- func (d *DbClient) Query(sql string, args ...any) (*sql.Rows, error)
- func (d *DbClient) QueryContext(ctx context.Context, sql string, args ...any) (*sql.Rows, error)
- func (d *DbClient) QueryRows(sql string, args ...any) (*DbRows, error)
- func (d *DbClient) QueryRowsContext(ctx context.Context, sql string, args ...any) (*DbRows, error)
- func (d *DbClient) SetConnMaxIdleTime(duration time.Duration)
- func (d *DbClient) SetConnMaxLifetime(duration time.Duration)
- func (d *DbClient) SetMaxIdleConns(n int)
- func (d *DbClient) SetMaxOpenConns(n int)
- func (d *DbClient) Update(table string, data map[string]interface{}, criteria map[string]interface{}) (sql.Result, error)
- type DbClientOption
- type DbColumnInfo
- type DbDatabaseInfo
- type DbRows
- type DbSchemaInfo
- type DbTableInfo
- type DbViewInfo
- type ExcelClient
- func (d *ExcelClient) AddRowData(row []interface{}) error
- func (d *ExcelClient) AddRowHeader(row []interface{}) error
- func (d *ExcelClient) Close() error
- func (d *ExcelClient) Create(file_name string, file_path string, opt ...ExcelClientWriterOption) error
- func (d *ExcelClient) FetchRow() (string, int64, []string, error)
- func (d *ExcelClient) GetBasePath() string
- func (d *ExcelClient) ImportFromCSV(file_path string, opt ...CSVClientReaderOption) (int64, error)
- func (d *ExcelClient) ImportFromRowStream(rows *sql.Rows, ...) (int64, error)
- func (d *ExcelClient) Read(file_path string, opt ...ExcelClientReaderOption) ([]string, error)
- func (d *ExcelClient) Save() (string, error)
- type ExcelClientReaderOption
- type ExcelClientWriterOption
- type FtpClient
- func (d *FtpClient) ChangeDir(directory string) error
- func (d *FtpClient) Connect() error
- func (d *FtpClient) CurrentDir() (string, error)
- func (d *FtpClient) Delete(filePath string) error
- func (d *FtpClient) Download(ftp_source_path string, local_target_path string) error
- func (d *FtpClient) GetList(directory string) ([]*ftp.Entry, error)
- func (d *FtpClient) GetStringFileType(t ftp.EntryType) string
- func (d *FtpClient) IsConnected() bool
- func (d *FtpClient) IsInProgress() bool
- func (d *FtpClient) MakeDir(path string) error
- func (d *FtpClient) Quit() error
- func (d *FtpClient) Upload(local_source_path string, ftp_target_path string) error
- type Rest
- func (this *Rest) ClearHeaders()
- func (this *Rest) Curl(rest_method string, rest_url string, data_url map[string]string, ...) (string, error)
- func (this *Rest) CurlBinary(rest_method string, rest_url string, data_url map[string]string, ...) (*http.Response, error)
- func (this *Rest) Delete(rest_url string, data map[string]string) (string, error)
- func (this *Rest) Get(rest_url string, data map[string]string) (string, error)
- func (this *Rest) GetDownload(rest_url string, form_type string, data map[string]string, output_path string) (string, error)
- func (this *Rest) GetFileContentType(out *os.File) (string, error)
- func (this *Rest) GetHeader(key string) (string, bool)
- func (this *Rest) GetHeaders() map[string]string
- func (this *Rest) Post(rest_url string, form_type string, data map[string]interface{}) (string, error)
- func (this *Rest) PostDownload(rest_url string, form_type string, data map[string]interface{}, ...) (string, error)
- func (this *Rest) Put(rest_url string, form_type string, data map[string]interface{}) (string, error)
- func (this *Rest) RemoveHeader(key string)
- func (this *Rest) SetHeader(key string, value string)
- func (this *Rest) SetHeaders(header map[string]string)
- func (this *Rest) SetIdleConnTimeout(idleConnTimeout int64)
- func (this *Rest) SetMaxIdleConns(maxIdleConns int)
- func (this *Rest) SetMaxIdleConnsPerHost(maxIdleConnsPerHost int)
- func (this *Rest) SetSSLInsecureSkipVerify(value bool)
- func (this *Rest) SetTimeout(timeout int64)
- type RestClient
- func (d *RestClient) ClearHeaders()
- func (d *RestClient) Delete(rest_url string, data map[string]string) (string, error)
- func (d *RestClient) Get(rest_url string, data map[string]string) (string, error)
- func (d *RestClient) GetHeader(key string) (string, bool)
- func (d *RestClient) GetHeaders() map[string]string
- func (d *RestClient) Post(rest_url string, form_type string, data map[string]interface{}) (string, error)
- func (d *RestClient) Put(rest_url string, form_type string, data map[string]interface{}) (string, error)
- func (d *RestClient) RemoveHeader(key string)
- func (d *RestClient) SetHeader(key string, value string)
- func (d *RestClient) SetHeaders(header map[string]string)
- type TaskClient
- func (d *TaskClient) FileCompress(filename []string, delete_after_compress bool) (string, error)
- func (d *TaskClient) FileDelete(filename string) (string, error)
- func (d *TaskClient) FileDownload(filename string, download_path string) (string, error)
- func (d *TaskClient) FileExists(filename string) (string, error)
- func (d *TaskClient) FileExtract(filename string, delete_after_extract bool) (string, error)
- func (d *TaskClient) FileRename(filename string, new_filename string) (string, error)
- func (d *TaskClient) FileTaskList() (map[string]map[string]map[string]interface{}, error)
- func (d *TaskClient) FileTaskStatus(id string) (map[string]string, error)
- func (d *TaskClient) FileUpload(file_path string) (string, error)
- func (d *TaskClient) GitBranch(path string) (string, error)
- func (d *TaskClient) GitPull(path string) (string, error)
- func (d *TaskClient) GitStatus(path string) (string, error)
- func (d *TaskClient) GitVersion() (string, error)
- func (d *TaskClient) GoBuild(path string, output ...string) (string, error)
- func (d *TaskClient) GoVersion() (string, error)
- func (d *TaskClient) NewDbClient(dbcon_type string, dbcon_host string, dbcon_port string, dbcon_dbname string, ...) (DBClient, error)
- func (d *TaskClient) NewFtpClient(address string, port int, userName string, password string, sftp ...bool) (TcFtpClient, error)
- func (d *TaskClient) NewRestClient() RestClient
- func (d *TaskClient) ServiceStart(service_name string) (string, error)
- func (d *TaskClient) ServiceStop(service_name string) (string, error)
- func (d *TaskClient) SystemCheckDomain(domain string) (string, error)
- func (d *TaskClient) SystemInfo() (map[string]interface{}, error)
- func (d *TaskClient) SystemMemory() (map[string]interface{}, error)
- func (d *TaskClient) SystemNetConnect(host string, arr_port []int) (map[int64]bool, error)
- type TcFtpClient
- func (d *TcFtpClient) Download(ftp_source string, local_destination string) (string, error)
- func (d *TcFtpClient) TaskList() (map[string]map[string]map[string]string, error)
- func (d *TcFtpClient) TaskStatus(id string) (map[string]string, error)
- func (d *TcFtpClient) Upload(local_source string, ftp_destination string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddLogError ¶
func AddLogError(message string)
func AddLogErrorWithFields ¶
func AddLogInfo ¶
func AddLogInfo(message string)
func AddLogInfoWithFields ¶
func AddLogWarn ¶
func AddLogWarn(message string)
func AddLogWarnWithFields ¶
func DecryptWithKey ¶
Decrypts encrypted text with the passphrase
func EncryptWithKey ¶
Encrypts text with the passphrase
func GetFieldInteger ¶
func GetFieldString ¶
func GetIpFromDomain ¶
func GetIpOutbound ¶
func IsLetterOrSpace ¶
func IsStringJSON ¶
func LoggerInit ¶
func LoggerInit()
func RemoveDirectory ¶
func SliceExists ¶
func SliceExists(slice interface{}, item interface{}) bool
func VarDumpToString ¶
func VarDumpToString(data interface{}) string
Types ¶
type CSVClientReaderOption ¶
type CSVClientReaderOption struct { RowHeaderAt int64 RowDataAt int64 Delimiter rune NumberColumName []string NumberColumIndex []int64 OnImportProcessEachRow func(index_no int64, data []string, err error) (bool, []string) }
----- >> Import From CSV to Excel
type CsvWriterOption ¶
type DBClient ¶
type DBClient struct { IsConnected bool // contains filtered or unexported fields }
func (*DBClient) BulkImport ¶
func (*DBClient) DbToCsv ¶
func (d *DBClient) DbToCsv(sql string, opt ...CsvWriterOption) (string, error)
func (*DBClient) DbToExcel ¶
func (d *DBClient) DbToExcel(sql string, opt ...ExcelClientWriterOption) (string, error)
func (*DBClient) GetColumns ¶
func (d *DBClient) GetColumns(dbName string, tableName string) ([]*DbColumnInfo, error)
func (*DBClient) GetDatabases ¶
func (*DBClient) GetTables ¶
func (d *DBClient) GetTables() ([]*DbTableInfo, error)
type DataPaging ¶
type DataPaging struct { Page int64 `json:"page"` NumPage int64 `json:"num_page"` Total int64 `json:"total"` RowPerPage int64 `json:"row_per_page"` Rows interface{} `json:"rows"` SqlCount string `json:"-"` SqlCountTimeStart int64 `json:"-"` SqlCountTimeEnd int64 `json:"-"` SqlCountTimeDuration float64 `json:"-"` SqlPaging string `json:"-"` SqlPagingTimeStart int64 `json:"-"` SqlPagingTimeEnd int64 `json:"-"` SqlPagingTimeDuration float64 `json:"-"` }
type DbClient ¶
type DbClient struct {
// contains filtered or unexported fields
}
func NewDbclient ¶
func NewDbclient(param DbClientOption) (*DbClient, error)
func (*DbClient) DbfToLongChar ¶
func (*DbClient) ExecContext ¶
func (*DbClient) FindAllContext ¶
func (*DbClient) FindAllString ¶
func (*DbClient) FindAllStringContext ¶
func (*DbClient) FirstRowContext ¶
func (*DbClient) FirstRowString ¶
func (*DbClient) FirstRowStringtContext ¶
func (*DbClient) FirstValue ¶
func (*DbClient) FirstValueContext ¶
func (*DbClient) FirstValueString ¶
func (*DbClient) FirstValueStringContext ¶
func (*DbClient) GetColumns ¶
func (*DbClient) GetConfig ¶
func (d *DbClient) GetConfig() DbClientOption
func (*DbClient) GetDatabases ¶
func (d *DbClient) GetDatabases(filter ...string) ([]*DbDatabaseInfo, error)
func (*DbClient) GetSchemas ¶
func (d *DbClient) GetSchemas(databaseName ...string) ([]*DbSchemaInfo, error)
func (*DbClient) GetTables ¶
func (d *DbClient) GetTables(databaseName ...string) ([]*DbTableInfo, error)
func (*DbClient) GetViews ¶
func (d *DbClient) GetViews(databaseName ...string) ([]*DbViewInfo, error)
func (*DbClient) PagingContext ¶
func (*DbClient) QueryContext ¶
func (*DbClient) QueryRowsContext ¶
func (*DbClient) SetConnMaxIdleTime ¶
func (*DbClient) SetConnMaxLifetime ¶
func (*DbClient) SetMaxIdleConns ¶
func (*DbClient) SetMaxOpenConns ¶
type DbClientOption ¶
type DbColumnInfo ¶
type DbDatabaseInfo ¶
type DbRows ¶
type DbRows struct { ColumnInfo []*DbColumnInfo ErrColumnType error SqlTimeStart int64 SqlTimeEnd int64 SqlTimeDuration float64 IndexRow int64 FetchSpeed int64 // contains filtered or unexported fields }
func (*DbRows) ExportToCsv ¶
func (d *DbRows) ExportToCsv(csvConfig CsvWriterOption) (string, int64, error)
func (*DbRows) FetchInterfaceRows ¶
func (*DbRows) FetchStringRows ¶
type DbSchemaInfo ¶
type DbTableInfo ¶
type DbViewInfo ¶
type ExcelClient ¶
type ExcelClient struct {
// contains filtered or unexported fields
}
----- >> Base Excel Client
func (*ExcelClient) AddRowData ¶
func (d *ExcelClient) AddRowData(row []interface{}) error
----- >> Add Excel Row Data
func (*ExcelClient) AddRowHeader ¶
func (d *ExcelClient) AddRowHeader(row []interface{}) error
----- >> Add Excel Row Header
func (*ExcelClient) Close ¶
func (d *ExcelClient) Close() error
func (*ExcelClient) Create ¶
func (d *ExcelClient) Create(file_name string, file_path string, opt ...ExcelClientWriterOption) error
----- >> Create Excel
func (*ExcelClient) GetBasePath ¶
func (d *ExcelClient) GetBasePath() string
func (*ExcelClient) ImportFromCSV ¶
func (d *ExcelClient) ImportFromCSV(file_path string, opt ...CSVClientReaderOption) (int64, error)
func (*ExcelClient) ImportFromRowStream ¶
func (*ExcelClient) Read ¶
func (d *ExcelClient) Read(file_path string, opt ...ExcelClientReaderOption) ([]string, error)
type ExcelClientReaderOption ¶
type ExcelClientWriterOption ¶
type FtpClient ¶
type FtpClient struct { Address string `json:"host"` Port int `json:"port"` UserName string `json:"user_name"` Password string `json:"-"` Sftp bool `json:"sftp"` // contains filtered or unexported fields }
----- >> Base Ftp Client
func NewFtpClient ¶
func NewFtpClient(address string, port int, userName string, password string, sftp ...bool) (*FtpClient, error)
----- >> Init Ftp Client
func (*FtpClient) CurrentDir ¶
----- >> Get Current Dir
func (*FtpClient) IsConnected ¶
func (*FtpClient) IsInProgress ¶
type Rest ¶
type Rest struct {
// contains filtered or unexported fields
}
----- >> Base Rest Client
func (*Rest) ClearHeaders ¶
func (this *Rest) ClearHeaders()
func (*Rest) CurlBinary ¶
func (*Rest) GetDownload ¶
func (*Rest) GetFileContentType ¶
func (*Rest) GetHeaders ¶
func (*Rest) PostDownload ¶
func (*Rest) RemoveHeader ¶
func (*Rest) SetHeaders ¶
func (*Rest) SetIdleConnTimeout ¶
func (*Rest) SetMaxIdleConns ¶
----- >> Timeout Configuration
func (*Rest) SetMaxIdleConnsPerHost ¶
func (*Rest) SetSSLInsecureSkipVerify ¶
func (*Rest) SetTimeout ¶
type RestClient ¶
type RestClient struct { IsConnected bool // contains filtered or unexported fields }
----- >> Rest
func (*RestClient) ClearHeaders ¶
func (d *RestClient) ClearHeaders()
func (*RestClient) GetHeaders ¶
func (d *RestClient) GetHeaders() map[string]string
func (*RestClient) RemoveHeader ¶
func (d *RestClient) RemoveHeader(key string)
func (*RestClient) SetHeader ¶
func (d *RestClient) SetHeader(key string, value string)
func (*RestClient) SetHeaders ¶
func (d *RestClient) SetHeaders(header map[string]string)
type TaskClient ¶
type TaskClient struct { IsConnected bool // contains filtered or unexported fields }
----- >> Base Task Client
func NewTaskClient ¶
func NewTaskClient(url string, proxy []string) (TaskClient, error)
----- >> Init Task Client
func (*TaskClient) FileCompress ¶
func (d *TaskClient) FileCompress(filename []string, delete_after_compress bool) (string, error)
func (*TaskClient) FileDelete ¶
func (d *TaskClient) FileDelete(filename string) (string, error)
func (*TaskClient) FileDownload ¶
func (d *TaskClient) FileDownload(filename string, download_path string) (string, error)
func (*TaskClient) FileExists ¶
func (d *TaskClient) FileExists(filename string) (string, error)
----- >> File Operation
func (*TaskClient) FileExtract ¶
func (d *TaskClient) FileExtract(filename string, delete_after_extract bool) (string, error)
func (*TaskClient) FileRename ¶
func (d *TaskClient) FileRename(filename string, new_filename string) (string, error)
func (*TaskClient) FileTaskList ¶
func (d *TaskClient) FileTaskList() (map[string]map[string]map[string]interface{}, error)
func (*TaskClient) FileTaskStatus ¶
func (d *TaskClient) FileTaskStatus(id string) (map[string]string, error)
func (*TaskClient) FileUpload ¶
func (d *TaskClient) FileUpload(file_path string) (string, error)
func (*TaskClient) GitVersion ¶
func (d *TaskClient) GitVersion() (string, error)
func (*TaskClient) GoBuild ¶
func (d *TaskClient) GoBuild(path string, output ...string) (string, error)
----- >> Go
func (*TaskClient) GoVersion ¶
func (d *TaskClient) GoVersion() (string, error)
func (*TaskClient) NewDbClient ¶
func (d *TaskClient) NewDbClient(dbcon_type string, dbcon_host string, dbcon_port string, dbcon_dbname string, dbcon_user string, dbcon_pass string) (DBClient, error)
----- >> DB Operation
func (*TaskClient) NewFtpClient ¶
func (d *TaskClient) NewFtpClient(address string, port int, userName string, password string, sftp ...bool) (TcFtpClient, error)
----- >> FTP Operation
func (*TaskClient) NewRestClient ¶
func (d *TaskClient) NewRestClient() RestClient
func (*TaskClient) ServiceStart ¶
func (d *TaskClient) ServiceStart(service_name string) (string, error)
----- >> OS Service
func (*TaskClient) ServiceStop ¶
func (d *TaskClient) ServiceStop(service_name string) (string, error)
func (*TaskClient) SystemCheckDomain ¶
func (d *TaskClient) SystemCheckDomain(domain string) (string, error)
func (*TaskClient) SystemInfo ¶
func (d *TaskClient) SystemInfo() (map[string]interface{}, error)
----- >> System Info
func (*TaskClient) SystemMemory ¶
func (d *TaskClient) SystemMemory() (map[string]interface{}, error)
func (*TaskClient) SystemNetConnect ¶
type TcFtpClient ¶
type TcFtpClient struct {
// contains filtered or unexported fields
}
func (*TcFtpClient) Download ¶
func (d *TcFtpClient) Download(ftp_source string, local_destination string) (string, error)
func (*TcFtpClient) TaskStatus ¶
func (d *TcFtpClient) TaskStatus(id string) (map[string]string, error)
Click to show internal directories.
Click to hide internal directories.