modules

package
v0.0.0-...-dca265f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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 AddRequestListen(c *gin.Context)

func AuthHandler

func AuthHandler(c *gin.Context)

func AuthInit

func AuthInit(c *gin.Context)

func Certs

func Certs(c *gin.Context)

func ConnectStore

func ConnectStore(endPoints []string, username, password string) error

func DelCert

func DelCert(c *gin.Context)

func DelDomain

func DelDomain(c *gin.Context)

func DelPath

func DelPath(c *gin.Context)

func Domains

func Domains(c *gin.Context)

func Gateway

func Gateway(c *gin.Context)

func Gateways

func Gateways(c *gin.Context)

func GetDomain

func GetDomain(c *gin.Context)

func GetPath

func GetPath(c *gin.Context)

func Index

func Index(_ *gin.Context)

func Login

func Login(c *gin.Context)

func Logout

func Logout(c *gin.Context)

func Milliseconds

func Milliseconds(d time.Duration) float64

func Paths

func Paths(c *gin.Context)

func PutCert

func PutCert(c *gin.Context)

func PutDomain

func PutDomain(c *gin.Context)

func PutPath

func PutPath(c *gin.Context)

func RequestsCopy

func RequestsCopy(c *gin.Context)

Types

type AdminUser

type AdminUser struct {
	UserId   string
	UserName string
	Password string
	Salt     string
}

type Cert

type Cert struct {
	Id           string `json:"id"`
	SerName      string `json:"ser_name"`
	CertBlock    string `json:"cert_block"`
	CertKeyBlock string `json:"cert_key_block"`
	SetTime      string `json:"set_time"`
}

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 ErrorOutPut struct {
	Status    int `json:"status"`
	ErrorCode int `json:"error_code"`
}

type Gw

type Gw struct {
	ServerName string `json:"server_name"`
}

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 Record

type Record struct {
	Count   float64 `json:"count"`
	Mean    float64 `json:"mean"`
	Max     float64 `json:"max"`
	Min     float64 `json:"min"`
	TimeStr string  `json:"time_str"`
}

type RecordsData

type RecordsData struct {
	Time        int64                             `json:"time"`
	MetricsData map[string]map[string]interface{} `json:"metrics_data"`
}

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 RequestListen struct {
	DomainUrl  string `json:"domain_url"`
	ListenPath string `json:"listen_path"`
}

type SuccessOutPut

type SuccessOutPut struct {
	Status int         `json:"status"`
	Data   interface{} `json:"data"`
}

type Target

type Target struct {
	Pointer       string `json:"pointer"`
	Weight        int8   `json:"weight"`
	CurrentWeight int8   `json:"current_weight"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL