Documentation ¶
Index ¶
- Variables
- func Execute(table string, sql string, values []interface{}, db *sql.DB) (int64, error)
- func ExecuteSQL(table string, sets map[string]interface{}, db *sql.DB) (int64, error)
- func FormatUpdateSQL(sets map[string]interface{}, where map[string]interface{})
- func Get(url string) ([]byte, error)
- func GetInsertSQL(table string, sets map[string]interface{}) string
- func GetLogPath() string
- func GetSSHConfig() *sshConfig
- func InitGorm(key string) *gorm.DB
- func InitMgo(key string) *mgo.Session
- func InitMongo(key string) *mongo.Client
- func InitMysql(key string) *sql.DB
- func InitRedis(key string, db int) *redis.Pool
- func InitRedis1(key string, db int) *redisv7.Client
- func InitRedis1ConfDb(key string) *redisv7.Client
- func InitRedisConfDb(key string) *redis.Pool
- func NewLoger(path string) *zap.Logger
- func PostData(url string, b string) ([]byte, error)
- func PostForm(urlx string, b url.Values) ([]byte, error)
- func PostJSON(url string, b []byte) ([]byte, error)
- func ReadCsv(path string, message chan []string, midf func([]string, int), end func(int), ...) error
- func ReadCsvWorker(path string, midf func([]string, int), endf func(int), fNum int, ...) error
- func RegisterDialContext()
- type Client
- type ConfigParse
- type LoggerItem
- func (c *LoggerItem) ERROR(mark string, brief string, msg string)
- func (c *LoggerItem) Error(err interface{}, funcName string, args ...interface{})
- func (c *LoggerItem) Errorf(args ...interface{})
- func (c *LoggerItem) INFO(mark string, brief string, msg string)
- func (c *LoggerItem) Infof(args ...interface{})
- func (c *LoggerItem) WARN(mark string, brief string, msg string)
- func (c *LoggerItem) Warnf(args ...interface{})
- type LoggerTools
- type MongoConf
- type MysqlConf
- type RedisConf
- type TerminalConfig
- type ViaSSHDialer
Constants ¶
This section is empty.
Variables ¶
var LocationIP string
LocationIP 本地ip
Functions ¶
func ExecuteSQL ¶ added in v0.0.10
ExecuteSQL sql转换
func FormatUpdateSQL ¶ added in v0.0.10
FormatUpdateSQL 整理uppdate的sql语句
func GetInsertSQL ¶ added in v0.0.10
GetInsertSQL 获取sql
func ReadCsv ¶ added in v0.0.8
func ReadCsv(path string, message chan []string, midf func([]string, int), end func(int), fNum int) error
ReadCsv csv 文件读取
func ReadCsvWorker ¶ added in v0.0.8
func ReadCsvWorker(path string, midf func([]string, int), endf func(int), fNum int, worker func(chan []string, *sync.WaitGroup), workerNumber int) error
ReadCsvWorker 读取文件,并且有worker 消耗文件 path 文件路径 midf 读取函数中间操作, fNum读取多少个文件执行f函数 worker 工作池 ,workerNumber 工作池数量
func RegisterDialContext ¶ added in v0.0.12
func RegisterDialContext()
Types ¶
type Client ¶ added in v0.0.12
type Client struct {
// contains filtered or unexported fields
}
func Dial ¶ added in v0.0.12
func Dial(network, addr string, config *ssh.ClientConfig) (*Client, error)
Dial starts a client connection to the given SSH server. This is wrap the ssh.Dial
func DialWithKey ¶ added in v0.0.12
DialWithKey starts a client connection to the given SSH server with key authmethod.
func DialWithKeyWithPassphrase ¶ added in v0.0.12
DialWithKeyWithPassphrase same as DialWithKey but with a passphrase to decrypt the private key
func DialWithPasswd ¶ added in v0.0.12
DialWithPasswd starts a client connection to the given SSH server with passwd authmethod.
func (*Client) ScriptFile ¶ added in v0.0.12
ScriptFile
func (*Client) Shell ¶ added in v0.0.12
func (c *Client) Shell() *remoteShell
Shell create a noninteractive shell on client.
func (*Client) Terminal ¶ added in v0.0.12
func (c *Client) Terminal(config *TerminalConfig) *remoteShell
Terminal create a interactive shell on client.
type ConfigParse ¶
ConfigParse 配置环境
type LoggerItem ¶ added in v0.0.7
type LoggerItem struct {
// contains filtered or unexported fields
}
LoggerItem 容量切割
func NewLoggerItem ¶ added in v0.0.7
func NewLoggerItem(Filename string) *LoggerItem
NewLoggerItem 创建日志工具
func (*LoggerItem) ERROR ¶ added in v0.0.7
func (c *LoggerItem) ERROR(mark string, brief string, msg string)
ERROR warn
func (*LoggerItem) Error ¶ added in v0.0.7
func (c *LoggerItem) Error(err interface{}, funcName string, args ...interface{})
Error 打印错误日志
func (*LoggerItem) Errorf ¶ added in v0.0.7
func (c *LoggerItem) Errorf(args ...interface{})
Errorf 打印错误日志
func (*LoggerItem) INFO ¶ added in v0.0.7
func (c *LoggerItem) INFO(mark string, brief string, msg string)
INFO info信息打印
func (*LoggerItem) Infof ¶ added in v0.0.7
func (c *LoggerItem) Infof(args ...interface{})
Infof 打印普通日志
func (*LoggerItem) WARN ¶ added in v0.0.7
func (c *LoggerItem) WARN(mark string, brief string, msg string)
WARN warn
func (*LoggerItem) Warnf ¶ added in v0.0.7
func (c *LoggerItem) Warnf(args ...interface{})
Warnf 打印错误日志
type LoggerTools ¶ added in v0.0.7
type LoggerTools struct {
// contains filtered or unexported fields
}
LoggerTools 日志工具
func NewLoggerTools ¶ added in v0.0.7
func NewLoggerTools(path string) *LoggerTools
NewLoggerTools log 初始化
func (*LoggerTools) ERROR ¶ added in v0.0.7
func (c *LoggerTools) ERROR(mark string, brief string, msg string)
ERROR error打印
type MongoConf ¶ added in v0.0.6
MongoConf mongo 配置文件
func NewMongoConf ¶ added in v0.0.6
NewMongoConf 获取mongo conf
type RedisConf ¶ added in v0.0.6
RedisConf redis配置信息
func NewRedisConf ¶ added in v0.0.6
NewRedisConf redis配置初始化
type TerminalConfig ¶ added in v0.0.12
type TerminalConfig struct { Term string Height int Weight int Modes ssh.TerminalModes }
type ViaSSHDialer ¶ added in v0.0.12
type ViaSSHDialer struct {
// contains filtered or unexported fields
}
func NewViaSSHDialer ¶ added in v0.0.12
func NewViaSSHDialer(client *ssh.Client) *ViaSSHDialer