Documentation
      ¶
    
    
  
    
      Index ¶
- Variables
 - func CheckPid(path string) *os.Process
 - func CloseHTTPClient(client *http.Client)
 - func ConvertJSONObjectSafely(obj interface{}) interface{}
 - func CopyStructObject(destPtr, sourcePtr interface{})
 - func DeletePid(path string) error
 - func DumpResponse(resp *http.Response) (header []byte, body []byte, err error)
 - func FormatAddress(addr string) string
 - func FormatAddressList(addrList []string) []string
 - func Get(object interface{}, keys []string) interface{}
 - func ListenSignal(f func(sig os.Signal), sig ...os.Signal)
 - func LockFile(fp *os.File) error
 - func MapKeys(s maps.Map) (keys []string)
 - func MapToObjectJSON(fromMap map[string]interface{}, toPtr interface{}) error
 - func MapToObjectYAML(fromMap map[string]interface{}, toPtr interface{}) error
 - func MatchDomains(patterns []string, domain string) (isMatched bool)
 - func MatchKeyword(source, keyword string) bool
 - func NewHTTPClient(timeout time.Duration) *http.Client
 - func NotifySignal(proc *os.Process, sig os.Signal) error
 - func ObjectToMapJSON(fromPtr interface{}, toMap *map[string]interface{}) error
 - func ParseVariables(source string, replacer func(varName string) (value string)) string
 - func Recover()
 - func SetRLimit(limit uint64) error
 - func SetSuitableRLimit()
 - func SharedHttpClient(timeout time.Duration) *http.Client
 - func TmpFile(path string) string
 - func UnlockFile(fp *os.File) error
 - func UnsafeBytesToString(bs []byte) string
 - func UnsafeStringToBytes(s string) []byte
 - func WritePid(path string) error
 - func WritePpid(path string) error
 - type BytePool
 - type Command
 - type CommandExecutor
 - type CommandHelp
 - func (this *CommandHelp) Append(appendString string) *CommandHelp
 - func (this *CommandHelp) Option(code string, description string) *CommandHelp
 - func (this *CommandHelp) Print()
 - func (this *CommandHelp) Product(product string) *CommandHelp
 - func (this *CommandHelp) Usage(usage string) *CommandHelp
 - func (this *CommandHelp) Version(version string) *CommandHelp
 
- type CommandHelpOption
 - type ObjectPool
 - type ServiceManager
 - func (this *ServiceManager) Close() error
 - func (this *ServiceManager) Install(exePath string, args []string) error
 - func (this *ServiceManager) Log(msg string)
 - func (this *ServiceManager) LogError(msg string)
 - func (this *ServiceManager) PauseWindow()
 - func (this *ServiceManager) Start() error
 - func (this *ServiceManager) Uninstall() error
 
- type Ticker
 - type VariableHolder
 
Constants ¶
This section is empty.
Variables ¶
      View Source
      
  
    var AllCharsets = []maps.Map{}/* 122 elements not displayed */
    
      View Source
      
  var BasicCharsets = []maps.Map{
	{"name": "Chinese Traditional (Big5)", "charset": "big5"},
	{"charset": "euc-kr", "name": "Korean (EUC)"},
	{"charset": "iso-8859-1", "name": "Western Alphabet"},
	{"charset": "iso-8859-2", "name": "Central European Alphabet (ISO)"},
	{"charset": "iso-8859-3", "name": "Latin 3 Alphabet (ISO)"},
	{"charset": "iso-8859-4", "name": "Baltic Alphabet (ISO)"},
	{"charset": "iso-8859-5", "name": "Cyrillic Alphabet (ISO)"},
	{"charset": "iso-8859-6", "name": "Arabic Alphabet (ISO)"},
	{"charset": "iso-8859-7", "name": "Greek Alphabet (ISO)"},
	{"charset": "iso-8859-8", "name": "Hebrew Alphabet (ISO)"},
	{"charset": "koi8-r", "name": "Cyrillic Alphabet (KOI8-R)"},
	{"charset": "shift-jis", "name": "Japanese (Shift-JIS)"},
	{"name": "Japanese (EUC)", "charset": "x-euc"},
	{"charset": "utf-8", "name": "Universal Alphabet (UTF-8)"},
	{"charset": "windows-1250", "name": "Central European Alphabet (Windows)"},
	{"charset": "windows-1251", "name": "Cyrillic Alphabet (Windows)"},
	{"charset": "windows-1252", "name": "Western Alphabet (Windows)"},
	{"charset": "windows-1253", "name": "Greek Alphabet (Windows)"},
	{"charset": "windows-1254", "name": "Turkish Alphabet"},
	{"charset": "windows-1255", "name": "Hebrew Alphabet (Windows)"},
	{"charset": "windows-1256", "name": "Arabic Alphabet (Windows)"},
	{"charset": "windows-1257", "name": "Baltic Alphabet (Windows)"},
	{"charset": "windows-1258", "name": "Vietnamese Alphabet (Windows)"},
	{"charset": "windows-874", "name": "Thai (Windows)"},
}
    数据来自 https://webcheatsheet.com/html/character_sets_list.php
      View Source
      
  
    var RegexpDigitNumber = regexp.MustCompile("^\\d+$")
    
      View Source
      
  
var UsualCharsets = []maps.Map{
	{"charset": "utf-8", "name": "Universal Alphabet (UTF-8)"},
	{"charset": "unicode", "name": "Unicode"},
	{"name": "Chinese Simplified (GB2312)", "charset": "gb2312"},
	{"charset": "big5", "name": "Chinese Traditional (Big5)"},
	{"charset": "iso-8859-1", "name": "Western Alphabet"},
	{"charset": "euc-kr", "name": "Korean (EUC)"},
	{"charset": "shift-jis", "name": "Japanese (Shift-JIS)"},
	{"charset": "us-ascii", "name": "US-ASCII"},
}
    Functions ¶
func ConvertJSONObjectSafely ¶ added in v0.1.2
func ConvertJSONObjectSafely(obj interface{}) interface{}
    去除导致不能转换特殊内容的问题 当前不支持struct
func CopyStructObject ¶ added in v0.1.7
func CopyStructObject(destPtr, sourcePtr interface{})
    拷贝同类型struct指针对象中的字段
func DumpResponse ¶
导出响应
func FormatAddressList ¶ added in v0.1.8
format address list
func ListenSignal ¶ added in v0.1.9
监听Signal
func MapToObjectJSON ¶
通过JSON把map转换为object
func MapToObjectYAML ¶
通过YAML把map转换为object
func MatchDomains ¶
func MatchDomains(patterns []string, domain string) (isMatched bool)
从一组规则中匹配域名 支持的格式:example.com, www.example.com, .example.com, *.example.com, ~(\d+).example.com 更多参考:http://nginx.org/en/docs/http/ngx_http_core_module.html#server_name
func NewHTTPClient ¶ added in v0.1.6
获取一个新的Client
func NotifySignal ¶ added in v0.1.9
通知Signal
func ObjectToMapJSON ¶
通过JSON把object转换为map
func ParseVariables ¶
分析变量
func SharedHttpClient ¶ added in v0.1.6
获取一个公用的Client
func UnlockFile ¶ added in v0.1.9
func UnsafeBytesToString ¶ added in v0.1.9
convert bytes to string
func UnsafeStringToBytes ¶ added in v0.1.9
convert string to bytes
Types ¶
type BytePool ¶ added in v0.1.6
type BytePool struct {
	// contains filtered or unexported fields
}
    pool for get byte slice
type CommandExecutor ¶ added in v0.1.2
type CommandExecutor struct {
	// contains filtered or unexported fields
}
    命令执行器
func (*CommandExecutor) Add ¶ added in v0.1.2
func (this *CommandExecutor) Add(command string, arg ...string)
添加命令
func (*CommandExecutor) Run ¶ added in v0.1.2
func (this *CommandExecutor) Run() (output string, err error)
执行命令
type CommandHelp ¶ added in v0.1.9
type CommandHelp struct {
	// contains filtered or unexported fields
}
    命令帮助
func NewCommandHelp ¶ added in v0.1.9
func NewCommandHelp() *CommandHelp
func (*CommandHelp) Append ¶ added in v0.1.9
func (this *CommandHelp) Append(appendString string) *CommandHelp
附加内容
func (*CommandHelp) Option ¶ added in v0.1.9
func (this *CommandHelp) Option(code string, description string) *CommandHelp
选项
func (*CommandHelp) Product ¶ added in v0.1.9
func (this *CommandHelp) Product(product string) *CommandHelp
产品
func (*CommandHelp) Usage ¶ added in v0.1.9
func (this *CommandHelp) Usage(usage string) *CommandHelp
使用方法
func (*CommandHelp) Version ¶ added in v0.1.9
func (this *CommandHelp) Version(version string) *CommandHelp
版本
type CommandHelpOption ¶ added in v0.1.9
type ObjectPool ¶ added in v0.1.6
type ObjectPool struct {
	// contains filtered or unexported fields
}
    对象池
func NewObjectPool ¶ added in v0.1.6
func NewObjectPool(maxSize int, newFunc func() interface{}) *ObjectPool
创建新对象
type ServiceManager ¶ added in v0.1.6
type ServiceManager struct {
	Name        string
	Description string
	// contains filtered or unexported fields
}
    服务管理器
func NewServiceManager ¶ added in v0.1.6
func NewServiceManager(name, description string) *ServiceManager
获取对象
func (*ServiceManager) Install ¶ added in v0.1.6
func (this *ServiceManager) Install(exePath string, args []string) error
安装服务
func (*ServiceManager) LogError ¶ added in v0.1.6
func (this *ServiceManager) LogError(msg string)
记录错误日志
func (*ServiceManager) PauseWindow ¶ added in v0.1.6
func (this *ServiceManager) PauseWindow()
保持命令行窗口是打开的
func (*ServiceManager) Uninstall ¶ added in v0.1.6
func (this *ServiceManager) Uninstall() error
删除服务
      
      Source Files
      ¶
    
   Click to show internal directories. 
   Click to hide internal directories.