Documentation
¶
Index ¶
- Constants
- Variables
- func AddRequestListen(c *gin.Context)
- func AuthHandler(c *gin.Context)
- func AuthInit(c *gin.Context)
- func Certs(c *gin.Context)
- func ConnectStore(endPoints []string, username, password string) error
- func DelCert(c *gin.Context)
- func DelDomain(c *gin.Context)
- func DelPath(c *gin.Context)
- func Domains(c *gin.Context)
- func Gateway(c *gin.Context)
- func Gateways(c *gin.Context)
- func GetDomain(c *gin.Context)
- func GetPath(c *gin.Context)
- func Index(_ *gin.Context)
- func Login(c *gin.Context)
- func Logout(c *gin.Context)
- func Milliseconds(d time.Duration) float64
- func Paths(c *gin.Context)
- func PutCert(c *gin.Context)
- func PutDomain(c *gin.Context)
- func PutPath(c *gin.Context)
- func RequestsCopy(c *gin.Context)
- type AdminUser
- type Cert
- type Domain
- type ErrorOutPut
- type Gw
- type Path
- type Record
- type RecordsData
- type RequestCopy
- type RequestListen
- type SuccessOutPut
- type Target
Constants ¶
View Source
const ( DataParseError = -4001 DataCannotDeleteError = -3001 )
View Source
const ( SystemErrorNotInit = -2000 SystemErrorNotLogin = -2001 LoginParamsError = -2002 )
View Source
const Issuer = "hgw_admin"
View Source
const (
SystemError = -1001
)
View Source
const TokenExpire = 24 * time.Hour
Variables ¶
View Source
var LbMap = map[string]bool{"roundRobin": true, "random": true}
Functions ¶
func AddRequestListen ¶
func AuthHandler ¶
func ConnectStore ¶
func Milliseconds ¶
func RequestsCopy ¶
Types ¶
type Domain ¶
type Domain struct { Id string `json:"id"` DomainName string `json:"domain_name"` DomainUrl string `json:"domain_url"` LbType string `json:"lb_type"` Targets []*Target `json:"targets"` BlackIps map[string]bool `json:"black_ips"` RateLimiterNum float64 `json:"rate_limiter_num"` RateLimiterMsg string `json:"rate_limiter_msg"` RateLimiterEnabled bool `json:"rate_limiter_enabled"` SetTime string `json:"set_time"` }
type ErrorOutPut ¶
type Path ¶
type Path struct { Id string `json:"id"` DomainId string `json:"domain_id"` ReqMethod string `json:"req_method"` ReqPath string `json:"req_path"` SearchPath string `json:"search_path"` ReplacePath string `json:"replace_path"` CircuitBreakerRequest int `json:"circuit_breaker_request"` CircuitBreakerPercent int `json:"circuit_breaker_percent"` CircuitBreakerTimeout int `json:"circuit_breaker_timeout"` CircuitBreakerMsg string `json:"circuit_breaker_msg"` CircuitBreakerEnabled bool `json:"circuit_breaker_enabled"` CircuitBreakerForce bool `json:"circuit_breaker_force"` PrivateProxyEnabled bool `json:"private_proxy_enabled"` LbType string `json:"lb_type"` Targets []*Target `json:"targets"` SetTime string `json:"set_time"` }
type RecordsData ¶
type RequestCopy ¶
type RequestCopy struct { SerName string `json:"ser_name"` Id string `json:"id"` ReqTime string `json:"req_time"` ReqIp string `json:"req_ip"` ReqPath string `json:"req_path"` PostForm interface{} `json:"post_form"` Get string `json:"get"` ReqHeader interface{} `json:"req_header"` RspSize int `json:"rsp_size"` RspHeader http.Header `json:"rsp_header"` RspBody string `json:"rsp_body"` }
type RequestListen ¶
type SuccessOutPut ¶
type SuccessOutPut struct { Status int `json:"status"` Data interface{} `json:"data"` }
Click to show internal directories.
Click to hide internal directories.