本文整理匯總了Golang中github.com/benbearchen/asuran/profile.Profile.CommandUrl方法的典型用法代碼示例。如果您正苦於以下問題:Golang Profile.CommandUrl方法的具體用法?Golang Profile.CommandUrl怎麽用?Golang Profile.CommandUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/benbearchen/asuran/profile.Profile
的用法示例。
在下文中一共展示了Profile.CommandUrl方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Command
func (p *Proxy) Command(commands string, f *profile.Profile, v *life.Life) {
commandLines := strings.Split(commands, "\n")
for _, line := range commandLines {
line = strings.TrimSpace(line)
if len(line) <= 0 || line[0] == '#' {
continue
}
c, rest := cmd.TakeFirstArg(line)
switch c {
case "restart":
if v != nil {
v.Restart()
}
case "clear":
f.Clear()
case "delay":
f.CommandDelay(rest)
case "proxy":
f.CommandProxy(rest)
case "delete":
f.CommandDelete(rest)
case "domain":
f.CommandDomain(rest)
case "url":
f.CommandUrl(rest)
default:
if ip, domain, ok := parseIPDomain(c, rest); ok {
f.CommandDomain("redirect " + domain + " " + ip)
break
}
}
}
}