Documentation
¶
Index ¶
- type NNRMoe
- func (nnrMoe *NNRMoe) AddRule(rule *RequestAddRule) (result *ResponseRuleDetail)
- func (nnrMoe *NNRMoe) DeleteRule(ruleID *RequestRuleRid) (result *ResponseDeleteRule)
- func (nnrMoe *NNRMoe) EditRule(editedRule *RequestEditedRule) (result *ResponseRuleDetail)
- func (nnrMoe *NNRMoe) GetRule(ruleID *RequestRuleRid) (result *ResponseRuleDetail)
- func (nnrMoe *NNRMoe) GetServer(serverID string) (result *ResponseGetServer)
- func (nnrMoe *NNRMoe) Rules() (result *ResponseRules)
- func (nnrMoe *NNRMoe) Servers() (result *ResponseServers)
- type RequestAddRule
- type RequestEditedRule
- type RequestRuleRid
- type ResponseBase
- type ResponseDeleteRule
- type ResponseGetServer
- type ResponseRuleDetail
- type ResponseRules
- type ResponseServers
- type Rule
- type RuleBase
- type RuleList
- type ServerInfo
- type ServerList
- type TypeRequestBody
- type TypeResponse
- type URL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NNRMoe ¶
func (*NNRMoe) AddRule ¶
func (nnrMoe *NNRMoe) AddRule(rule *RequestAddRule) (result *ResponseRuleDetail)
func (*NNRMoe) DeleteRule ¶
func (nnrMoe *NNRMoe) DeleteRule(ruleID *RequestRuleRid) (result *ResponseDeleteRule)
func (*NNRMoe) EditRule ¶
func (nnrMoe *NNRMoe) EditRule(editedRule *RequestEditedRule) (result *ResponseRuleDetail)
func (*NNRMoe) GetRule ¶ added in v0.0.6
func (nnrMoe *NNRMoe) GetRule(ruleID *RequestRuleRid) (result *ResponseRuleDetail)
func (*NNRMoe) GetServer ¶ added in v0.0.6
func (nnrMoe *NNRMoe) GetServer(serverID string) (result *ResponseGetServer)
func (*NNRMoe) Rules ¶
func (nnrMoe *NNRMoe) Rules() (result *ResponseRules)
func (*NNRMoe) Servers ¶
func (nnrMoe *NNRMoe) Servers() (result *ResponseServers)
type RequestAddRule ¶
type RequestEditedRule ¶
type RequestRuleRid ¶ added in v0.0.6
type RequestRuleRid struct {
Rid string `json:"rid"`
}
type ResponseBase ¶
type ResponseBase struct {
Status int32
}
func (*ResponseBase) IsStatusOK ¶
func (rb *ResponseBase) IsStatusOK() bool
type ResponseDeleteRule ¶
type ResponseDeleteRule struct {
ResponseBase
Data RequestRuleRid
}
type ResponseGetServer ¶ added in v0.0.6
type ResponseGetServer struct {
ResponseBase
Data ServerInfo
}
type ResponseRuleDetail ¶ added in v0.0.6
type ResponseRuleDetail struct {
ResponseBase
Data Rule
}
type ResponseRules ¶
type ResponseRules struct {
ResponseBase
Data RuleList
}
type ResponseServers ¶
type ResponseServers struct {
ResponseBase
Data ServerList
}
type Rule ¶
type Rule struct {
RuleBase
Rid string `json:"rid"`
Uid string `json:"uid"`
Sid string `json:"sid"`
Host string `json:"host"`
Port int `json:"port"`
Status int `json:"status"`
Traffic int `json:"traffic"`
Data string `json:"data"`
Date int64 `json:"date"`
Setting struct {
ProxyProtocol int `json:"proxyProtocol"`
LoadbalanceMode string `json:"loadbalanceMode"`
Mix0Rtt bool `json:"mix0rtt"`
Src interface{} `json:"src"`
Cfips []interface{} `json:"cfips"`
} `json:"setting"`
}
type ServerInfo ¶
type ServerList ¶
type ServerList []ServerInfo
type TypeRequestBody ¶
type TypeRequestBody interface {
*RequestAddRule | *RequestRuleRid | *RequestEditedRule | string
}
type TypeResponse ¶
type TypeResponse interface {
*ResponseServers | *ResponseRuleDetail | *ResponseDeleteRule | *ResponseRules | *ResponseGetServer
IsStatusOK() bool
}
type URL ¶
type URL string
const ( URLServers URL = "https://nnr.moe/api/servers" URLRules URL = "https://nnr.moe/api/rules" URLAddRule URL = "https://nnr.moe/api/rules/add" URLDeleteRule URL = "https://nnr.moe/api/rules/del" URLEditRule URL = "https://nnr.moe/api/rules/edit" URLGetRule URL = "https://nnr.moe/api/rules/get" )
Click to show internal directories.
Click to hide internal directories.