Documentation
¶
Index ¶
- func ClearFileContent(filePath string) error
- func Configer(file string) config.Config
- func Exit(v ...any)
- func GetFileMD5(filePath string) (string, error)
- func GetLocation(target string) string
- func InForString(items []string, item string) bool
- func IsProcessRunning(processName string) (bool, error)
- func IsRelease() bool
- func KillProcessByName(processName string) error
- func MkdirAll(path string)
- func PanicErr(err error, v ...any)
- func PathExists(path string) (bool, error)
- func ReadFile(filePath string) string
- func ReplaceFile(sourcePath, destPath string) error
- func RootPath() string
- func StartProgram(programDir, programName string, args ...string) error
- type Cache
- type Config
- type DbPool
- func (p *DbPool) All() []map[string]interface{}
- func (p *DbPool) BatchInsert(params []map[string]interface{}) (affectRows int, err error)
- func (p *DbPool) Close()
- func (p *DbPool) Count() int
- func (p *DbPool) Delete() (affectRows int, err error)
- func (p *DbPool) Execute(Sql string) (affectRows int, err error)
- func (p *DbPool) FetchAll(Sql string) []map[string]interface{}
- func (p *DbPool) FetchOne(Sql string) map[string]interface{}
- func (p *DbPool) Get() map[string]interface{}
- func (p *DbPool) GetPool() *sql.DB
- func (p *DbPool) GroupBy(params ...string) *DbPool
- func (p *DbPool) Insert(params map[string]interface{}) (lastId int, err error)
- func (p *DbPool) LastSql() string
- func (p *DbPool) Limit(limit int) *DbPool
- func (p *DbPool) OrderBy(params ...string) *DbPool
- func (p *DbPool) Page(page int) *DbPool
- func (p *DbPool) Select(params ...string) *DbPool
- func (p *DbPool) Table(name string) *DbPool
- func (p *DbPool) Tx(tx *sql.Tx) *DbPool
- func (p *DbPool) Update(params map[string]interface{}) (affectRows int, err error)
- func (p *DbPool) Where(query interface{}, values ...interface{}) *DbPool
- type FilesystemInfo
- type Gosf
- type Header
- type Logger
- type Mysql
- type Proxy
- type Request
- func (p *Request) AddHeader(key string, value string) *Request
- func (p *Request) AddParam(property string, value string) *Request
- func (p *Request) Body(body string) *Request
- func (p *Request) BuildParams() string
- func (p *Request) Do() (error, []byte)
- func (p *Request) Get() (error, []byte)
- func (p *Request) InitFrom(reqParams *Request) *Request
- func (p *Request) Post() (error, []byte)
- func (p *Request) Proxy(proxy Proxy) *Request
- func (p *Request) Timeout(timeout int) *Request
- func (p *Request) Url(url string) *Request
- type System
- type Task
- type Upgrade
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetFileMD5 ¶
func GetLocation ¶
func InForString ¶
func IsProcessRunning ¶
func KillProcessByName ¶
func StartProgram ¶
Types ¶
type Config ¶
type Config struct {
Name string // APP名称,默认二进制文件名
Path string // APP所在路径,默认二进制文件所在目录
LogPath string // APP日志保存目录
LogMaxSize int // 日志文件最大大小,单位M
Version string
}
Config APP配置
type DbPool ¶
type DbPool struct {
// contains filtered or unexported fields
}
DbPool 数据库操作处理结构体
func (*DbPool) BatchInsert ¶
BatchInsert 批量插入
type FilesystemInfo ¶
type FilesystemInfo struct {
Filesystem string `json:"filesystem"`
Size string `json:"size"`
Used string `json:"used"`
Available string `json:"available"`
Use string `json:"use"`
Mount string `json:"mount"`
}
FilesystemInfo 磁盘挂载信息
type Gosf ¶
type Logger ¶
type Mysql ¶
type Mysql struct {
// contains filtered or unexported fields
}
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
Request Manage the HTTP GET request parameters
func NewRequest ¶
func NewRequest() *Request
func (*Request) BuildParams ¶
BuildParams Concat the property and value pair
type System ¶
type System struct {
Cpu string `json:"cpu"`
InternalIp []string `json:"internal_ip"`
PublicIp string `json:"public_ip"`
Disk string `json:"disk"`
Mac string `json:"mac"`
Now string `json:"now"`
}
func (*System) GetAvailable ¶
GetAvailable 获取指定目录可用磁盘大小
func (*System) GetInternalIPs ¶
GetInternalIPs 获取所有内网IP地址
func (*System) GetPublicIP ¶
type Upgrade ¶
type Upgrade struct {
ID string // 【需要设置】当前服务器标识(根据各自业务而定,可以是自定义的唯一标识,也可以是公网IP、MAC地址等)
AppPath string // 【必须设置】APP 所在路劲
AppName string // 【必须设置】APP 名称
CheckUrl string // 【必须设置】最新版本文件MD5
FileUrl string // 【必须设置】最新版本文件下载链接
// contains filtered or unexported fields
}
func NewUpgrade ¶
func NewUpgrade() *Upgrade
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
package config implements methods for reading config files encoded in json using path expressions and default fallback values thanks to https://github.com/creamdog/gonfig
|
package config implements methods for reading config files encoded in json using path expressions and default fallback values thanks to https://github.com/creamdog/gonfig |
Click to show internal directories.
Click to hide internal directories.