Documentation ¶
Index ¶
- Variables
- func BackoffErrorNotify(prefix string) backoff.Notify
- func BsonMEqual(v1, v2 bson.M) (ok bool)
- func BytesToString(b []byte) string
- func CleanupDemo() (err error)
- func Close(c io.Closer)
- func Compress(files []*os.File, dest string) error
- func ComputeHmacSha256(message string, secret string) string
- func Contains(array interface{}, val interface{}) (fla bool)
- func CopyDir(src string, dst string) error
- func CopyFile(src, dst string) error
- func DeCompress(srcFile *os.File, dstPath string) error
- func DecryptAES(src string) (res string, err error)
- func DefaultWait()
- func DenormalizeBsonMObjectId(m bson.M) (res bson.M)
- func EncryptAES(src string) (res string, err error)
- func EncryptMd5(str string) string
- func EnvIsTrue(key string, defaultOk bool) bool
- func Exists(path string) bool
- func FilterToQuery(f interfaces.Filter) (q bson.M, err error)
- func ForceInitModule(fn func() error) (err error)
- func GetApiAddress() (res string)
- func GetArrayItems(array interface{}) (res []interface{}, err error)
- func GetCockroachdbSession(ds *models.DataSource) (s db.Session, err error)
- func GetCockroachdbSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
- func GetCockroachdbSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
- func GetElasticsearchClient(ds *models.DataSource) (c *elasticsearch.Client, err error)
- func GetElasticsearchClientWithTimeout(ds *models.DataSource, timeout time.Duration) (c *elasticsearch.Client, err error)
- func GetElasticsearchClientWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (c *elasticsearch.Client, err error)
- func GetElasticsearchQuery(query generic.ListQuery) (buf *bytes.Buffer)
- func GetElasticsearchQueryWithOptions(query generic.ListQuery, opts *generic.ListOptions) (buf *bytes.Buffer)
- func GetFileHash(filePath string) (res string, err error)
- func GetFromDbCache(key string, getFn func() (string, error)) (res string, err error)
- func GetKafkaConnection(ds *models.DataSource) (c *kafka.Conn, err error)
- func GetKafkaConnectionWithTimeout(ds *models.DataSource, timeout time.Duration) (c *kafka.Conn, err error)
- func GetKafkaConnectionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (c *kafka.Conn, err error)
- func GetLocalTime(t time.Time) time.Time
- func GetLocalTimeString(t time.Time) string
- func GetMongoClient(ds *models.DataSource) (c *mongo2.Client, err error)
- func GetMongoClientWithTimeout(ds *models.DataSource, timeout time.Duration) (c *mongo2.Client, err error)
- func GetMongoClientWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (c *mongo2.Client, err error)
- func GetMongoOpts(opts *generic.ListOptions) (res *mongo.FindOptions)
- func GetMongoQuery(query generic.ListQuery) (res bson.M)
- func GetMssqlSession(ds *models.DataSource) (s db.Session, err error)
- func GetMssqlSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
- func GetMssqlSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
- func GetMysqlSession(ds *models.DataSource) (s db.Session, err error)
- func GetMysqlSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
- func GetMysqlSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
- func GetNodeType() string
- func GetObjectHash(obj any) string
- func GetPostgresqlSession(ds *models.DataSource) (s db.Session, err error)
- func GetPostgresqlSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
- func GetPostgresqlSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
- func GetResultHash(value interface{}, keys []string) (res string, err error)
- func GetRpcParam(key string, params map[string]string) string
- func GetSecretKey() string
- func GetSecretKeyBytes() []byte
- func GetSpiderCol(col string, name string) string
- func GetSqlQuery(query generic.ListQuery) (res db.Cond)
- func GetSqliteSession(ds *models.DataSource) (s db.Session, err error)
- func GetSqliteSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
- func GetSqliteSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
- func GetTimeDuration(num string, unit string) (d time.Duration, err error)
- func GetTimeString(t time.Time) string
- func GetTimeUnitParts(timeUnit string) (num int, unit string, err error)
- func GetUserFromArgs(args ...interface{}) (u interfaces.User)
- func HandleError(statusCode int, c *gin.Context, err error)
- func HandleErrorInternalServerError(c *gin.Context, err error)
- func HandleErrorUnauthorized(c *gin.Context, err error)
- func ImportDemo() (err error)
- func InitGitClientAuth(g interfaces.Git, gitClient *vcs.GitClient)
- func InitModule(id interfaces.ModuleId, fn func() error) (err error)
- func InitializedDemo() (ok bool)
- func IsCancellable(status string) bool
- func IsDebug() bool
- func IsDemo() (ok bool)
- func IsDir(path string) bool
- func IsDocker() (ok bool)
- func IsMaster() bool
- func IsPro() bool
- func JsonToBytes(d interface{}) (bytes []byte, err error)
- func ListDir(path string) ([]fs.FileInfo, error)
- func LogDebug(msg string)
- func NewUUIDString() (res string)
- func NormalizeBsonMObjectId(m bson.M) (res bson.M)
- func NormalizeObjectId(v interface{}) (res interface{})
- func ObjectToString(params interface{}) string
- func OpenFile(fileName string) *os.File
- func ReimportDemo() (err error)
- func ScanDirectory(dir string) (res map[string]entity.FsFileInfo, err error)
- func ShuffleArray(slice []interface{}) (err error)
- func StringArrayContains(arr []string, str string) bool
- func TrimFileData(data []byte) (res []byte)
- func VisualizeContainer(c *dig.Container) (err error)
- func ZipDirectory(dir, zipfile string) error
- type ChanMap
Constants ¶
This section is empty.
Variables ¶
View Source
var CronUtils = cronUtils{ // contains filtered or unexported fields }
View Source
var TaskExecChanMap = NewChanMap()
Functions ¶
func BackoffErrorNotify ¶
func BackoffErrorNotify(prefix string) backoff.Notify
func BsonMEqual ¶
func BytesToString ¶
func CleanupDemo ¶
func CleanupDemo() (err error)
func ComputeHmacSha256 ¶
func DecryptAES ¶
func DefaultWait ¶
func DefaultWait()
func EncryptAES ¶
func EncryptMd5 ¶
func FilterToQuery ¶
func FilterToQuery(f interfaces.Filter) (q bson.M, err error)
FilterToQuery Translate entity.Filter to bson.M
func ForceInitModule ¶
func GetApiAddress ¶
func GetApiAddress() (res string)
func GetArrayItems ¶
func GetArrayItems(array interface{}) (res []interface{}, err error)
func GetCockroachdbSession ¶
func GetCockroachdbSession(ds *models.DataSource) (s db.Session, err error)
func GetCockroachdbSessionWithTimeout ¶
func GetCockroachdbSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
func GetCockroachdbSessionWithTimeoutV2 ¶
func GetCockroachdbSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
func GetElasticsearchClient ¶
func GetElasticsearchClient(ds *models.DataSource) (c *elasticsearch.Client, err error)
func GetElasticsearchClientWithTimeout ¶
func GetElasticsearchClientWithTimeout(ds *models.DataSource, timeout time.Duration) (c *elasticsearch.Client, err error)
func GetElasticsearchClientWithTimeoutV2 ¶
func GetElasticsearchClientWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (c *elasticsearch.Client, err error)
func GetElasticsearchQuery ¶
func GetFileHash ¶
func GetFromDbCache ¶
func GetKafkaConnection ¶
func GetKafkaConnection(ds *models.DataSource) (c *kafka.Conn, err error)
func GetKafkaConnectionWithTimeout ¶
func GetKafkaConnectionWithTimeout(ds *models.DataSource, timeout time.Duration) (c *kafka.Conn, err error)
func GetKafkaConnectionWithTimeoutV2 ¶
func GetKafkaConnectionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (c *kafka.Conn, err error)
func GetLocalTimeString ¶
func GetMongoClient ¶
func GetMongoClient(ds *models.DataSource) (c *mongo2.Client, err error)
func GetMongoOpts ¶
func GetMongoOpts(opts *generic.ListOptions) (res *mongo.FindOptions)
func GetMssqlSession ¶
func GetMssqlSession(ds *models.DataSource) (s db.Session, err error)
func GetMssqlSessionWithTimeout ¶
func GetMssqlSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
func GetMssqlSessionWithTimeoutV2 ¶
func GetMssqlSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
func GetMysqlSession ¶
func GetMysqlSession(ds *models.DataSource) (s db.Session, err error)
func GetMysqlSessionWithTimeout ¶
func GetMysqlSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
func GetMysqlSessionWithTimeoutV2 ¶
func GetMysqlSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
func GetNodeType ¶
func GetNodeType() string
func GetObjectHash ¶
func GetPostgresqlSession ¶
func GetPostgresqlSession(ds *models.DataSource) (s db.Session, err error)
func GetPostgresqlSessionWithTimeout ¶
func GetPostgresqlSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
func GetPostgresqlSessionWithTimeoutV2 ¶
func GetPostgresqlSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
func GetResultHash ¶
func GetSecretKey ¶
func GetSecretKey() string
func GetSecretKeyBytes ¶
func GetSecretKeyBytes() []byte
func GetSpiderCol ¶
func GetSqlQuery ¶
func GetSqliteSession ¶
func GetSqliteSession(ds *models.DataSource) (s db.Session, err error)
func GetSqliteSessionWithTimeout ¶
func GetSqliteSessionWithTimeout(ds *models.DataSource, timeout time.Duration) (s db.Session, err error)
func GetSqliteSessionWithTimeoutV2 ¶
func GetSqliteSessionWithTimeoutV2(ds *models2.DatabaseV2, timeout time.Duration) (s db.Session, err error)
func GetTimeString ¶
func GetUserFromArgs ¶
func GetUserFromArgs(args ...interface{}) (u interfaces.User)
func HandleErrorUnauthorized ¶
func ImportDemo ¶
func ImportDemo() (err error)
func InitGitClientAuth ¶
func InitGitClientAuth(g interfaces.Git, gitClient *vcs.GitClient)
func InitModule ¶
func InitModule(id interfaces.ModuleId, fn func() error) (err error)
func InitializedDemo ¶
func InitializedDemo() (ok bool)
func IsCancellable ¶
func JsonToBytes ¶
func ListDir ¶
ListDir Add: 增加error类型作为第二返回值 在其他函数如 /task/log/file_driver.go中的 *FileLogDriver.cleanup()函数调用时 可以通过判断err是否为nil来判断是否有错误发生
func NewUUIDString ¶
func NewUUIDString() (res string)
func NormalizeObjectId ¶
func NormalizeObjectId(v interface{}) (res interface{})
func ReimportDemo ¶
func ReimportDemo() (err error)
func ScanDirectory ¶
func ScanDirectory(dir string) (res map[string]entity.FsFileInfo, err error)
func ShuffleArray ¶
func ShuffleArray(slice []interface{}) (err error)
func StringArrayContains ¶
func TrimFileData ¶
func VisualizeContainer ¶
func ZipDirectory ¶
Types ¶
type ChanMap ¶
type ChanMap struct {
// contains filtered or unexported fields
}
func NewChanMap ¶
func NewChanMap() *ChanMap
func (*ChanMap) ChanBlocked ¶
func (*ChanMap) HasChanKey ¶
Source Files ¶
- args.go
- array.go
- backoff.go
- bool.go
- bson.go
- cache.go
- chan.go
- cockroachdb.go
- cron.go
- debug.go
- demo.go
- di.go
- docker.go
- encrypt.go
- es.go
- file.go
- filter.go
- git.go
- hash.go
- helpers.go
- http.go
- init.go
- json.go
- kafka.go
- mongo.go
- mssql.go
- mysql.go
- node.go
- os.go
- postgresql.go
- result.go
- rpc.go
- spider.go
- sql.go
- sqlite.go
- stats.go
- system.go
- task.go
- time.go
- uuid.go
Click to show internal directories.
Click to hide internal directories.