Documentation ¶
Index ¶
- type AccessControl
- func (t *AccessControl) Find(c *gin.Context, tx *gorm.DB, search *AccessControl) (*AccessControl, error)
- func (t *AccessControl) ListBYServiceID(c *gin.Context, tx *gorm.DB, serviceID int64) ([]AccessControl, int64, error)
- func (t *AccessControl) Save(c *gin.Context, tx *gorm.DB) error
- func (t *AccessControl) TableName() string
- type Admin
- type App
- type GrpcRule
- type HttpRule
- type LoadBalance
- func (t *LoadBalance) Find(c *gin.Context, tx *gorm.DB, search *LoadBalance) (*LoadBalance, error)
- func (t *LoadBalance) GetIPListByModel() []string
- func (t *LoadBalance) GetWeightListByModel() []string
- func (t *LoadBalance) Save(c *gin.Context, tx *gorm.DB) error
- func (t *LoadBalance) TableName() string
- type ServiceDetail
- type ServiceInfo
- func (t *ServiceInfo) Find(c *gin.Context, tx *gorm.DB, search *ServiceInfo) (*ServiceInfo, error)
- func (t *ServiceInfo) GroupByLoadType(c *gin.Context, tx *gorm.DB) ([]model.DashServiceStatItemOutput, error)
- func (t *ServiceInfo) PageList(c *gin.Context, tx *gorm.DB, param *model.ServiceListInput) ([]ServiceInfo, int64, error)
- func (t *ServiceInfo) Save(c *gin.Context, tx *gorm.DB) error
- func (t *ServiceInfo) ServiceDetail(c *gin.Context, tx *gorm.DB, search *ServiceInfo) (*ServiceDetail, error)
- func (t *ServiceInfo) TableName() string
- type TcpRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessControl ¶
type AccessControl struct { ID int64 `json:"id" gorm:"primary_key"` ServiceID int64 `json:"service_id" gorm:"column:service_id" description:"服务id"` OpenAuth int `json:"open_auth" gorm:"column:open_auth" description:"是否开启权限 1=开启"` BlackList string `json:"black_list" gorm:"column:black_list" description:"黑名单ip "` WhiteList string `json:"white_list" gorm:"column:white_list" description:"白名单ip "` WhiteHostName string `json:"white_host_name" gorm:"column:white_host_name" description:"白名单主机 "` ClientIPFlowLimit int `json:"clientip_flow_limit" gorm:"column:clientip_flow_limit" description:"�客户端ip限流 "` ServiceFlowLimit int `json:"service_flow_limit" gorm:"column:service_flow_limit" description:"服务端限流 "` }
func (*AccessControl) Find ¶
func (t *AccessControl) Find(c *gin.Context, tx *gorm.DB, search *AccessControl) (*AccessControl, error)
func (*AccessControl) ListBYServiceID ¶
func (t *AccessControl) ListBYServiceID(c *gin.Context, tx *gorm.DB, serviceID int64) ([]AccessControl, int64, error)
func (*AccessControl) TableName ¶
func (t *AccessControl) TableName() string
type Admin ¶
type Admin struct { Id int `json:"id" gorm:"primary_key" description:"自增主键"` UserName string `json:"user_name" gorm:"column:user_name" description:"管理员用户名"` Salt string `json:"salt" gorm:"column:salt" description:"盐"` Password string `json:"password" gorm:"column:password" description:"密码"` UpdatedAt time.Time `json:"update_at" gorm:"column:update_at" description:"更新时间"` CreatedAt time.Time `json:"create_at" gorm:"column:create_at" description:"创建时间"` IsDelete int `json:"is_delete" gorm:"column:is_delete" description:"是否删除"` }
type App ¶
type App struct { ID int64 `json:"id" gorm:"primary_key"` AppID string `json:"app_id" gorm:"column:app_id" description:"�租户id "` Name string `json:"name" gorm:"column:name" description:"租户名称 "` Secret string `json:"secret" gorm:"column:secret" description:"密钥"` WhiteIPS string `json:"white_ips" gorm:"column:white_ips" description:"ip白名单,支持前缀匹配"` Qpd int64 `json:"qpd" gorm:"column:qpd" description:"日请求量限制"` Qps int64 `json:"qps" gorm:"column:qps" description:"每秒请求量限制"` CreatedAt time.Time `json:"create_at" gorm:"column:create_at" description:"添加时间 "` UpdatedAt time.Time `json:"update_at" gorm:"column:update_at" description:"更新时间"` IsDelete int8 `json:"is_delete" gorm:"column:is_delete" description:"是否已删除;0:否;1:是"` }
type GrpcRule ¶
type GrpcRule struct { ID int64 `json:"id" gorm:"primary_key"` ServiceID int64 `json:"service_id" gorm:"column:service_id" description:"服务id "` Port int `json:"port" gorm:"column:port" description:"端口 "` HeaderTransfor string `` /* 156-byte string literal not displayed */ }
func (*GrpcRule) ListByServiceID ¶
type HttpRule ¶
type HttpRule struct { ID int64 `json:"id" gorm:"primary_key"` ServiceID int64 `json:"service_id" gorm:"column:service_id" description:"服务id"` RuleType int `json:"rule_type" gorm:"column:rule_type" description:"匹配类型 domain=域名, url_prefix=url前缀"` Rule string `json:"rule" gorm:"column:rule" description:"type=domain表示域名,type=url_prefix时表示url前缀"` NeedHttps int `json:"need_https" gorm:"column:need_https" description:"type=支持https 1=支持"` NeedWebsocket int `json:"need_websocket" gorm:"column:need_websocket" description:"启用websocket 1=启用"` NeedStripUri int `json:"need_strip_uri" gorm:"column:need_strip_uri" description:"启用strip_uri 1=启用"` UrlRewrite string `json:"url_rewrite" gorm:"column:url_rewrite" description:"url重写功能,每行一个 "` HeaderTransfor string `` /* 157-byte string literal not displayed */ }
func (*HttpRule) ListByServiceID ¶
type LoadBalance ¶
type LoadBalance struct { ID int64 `json:"id" gorm:"primary_key"` ServiceID int64 `json:"service_id" gorm:"column:service_id" description:"服务id "` CheckMethod int `json:"check_method" gorm:"column:check_method" description:"检查方法 tcpchk=检测端口是否握手成功 "` CheckTimeout int `json:"check_timeout" gorm:"column:check_timeout" description:"check超时时间 "` CheckInterval int `json:"check_interval" gorm:"column:check_interval" description:"检查间隔, 单位s "` RoundType int `json:"round_type" gorm:"column:round_type" description:"轮询方式 round/weight_round/random/ip_hash"` IpList string `json:"ip_list" gorm:"column:ip_list" description:"ip列表"` WeightList string `json:"weight_list" gorm:"column:weight_list" description:"�权重列表"` ForbidList string `json:"forbid_list" gorm:"column:forbid_list" description:"禁用ip列表"` UpstreamConnectTimeout int `json:"upstream_connect_timeout" gorm:"column:upstream_connect_timeout" description:"下游建立连接超时, 单位s"` UpstreamHeaderTimeout int `json:"upstream_header_timeout" gorm:"column:upstream_header_timeout" description:"下游获取header超时, 单位s "` UpstreamIdleTimeout int `json:"upstream_idle_timeout" gorm:"column:upstream_idle_timeout" description:"下游链接最大空闲时间, 单位s "` UpstreamMaxIdle int `json:"upstream_max_idle" gorm:"column:upstream_max_idle" description:"下游最大空闲链接数"` }
func (*LoadBalance) Find ¶
func (t *LoadBalance) Find(c *gin.Context, tx *gorm.DB, search *LoadBalance) (*LoadBalance, error)
func (*LoadBalance) GetIPListByModel ¶
func (t *LoadBalance) GetIPListByModel() []string
func (*LoadBalance) GetWeightListByModel ¶
func (t *LoadBalance) GetWeightListByModel() []string
func (*LoadBalance) TableName ¶
func (t *LoadBalance) TableName() string
type ServiceDetail ¶
type ServiceDetail struct { Info *ServiceInfo `json:"info" description:"基本信息"` HTTPRule *HttpRule `json:"http_rule" description:"http_rule"` TCPRule *TcpRule `json:"tcp_rule" description:"tcp_rule"` GRPCRule *GrpcRule `json:"grpc_rule" description:"grpc_rule"` LoadBalance *LoadBalance `json:"load_balance" description:"load_balance"` AccessControl *AccessControl `json:"access_control" description:"access_control"` }
type ServiceInfo ¶
type ServiceInfo struct { ID int64 `json:"id" gorm:"primary_key"` LoadType int `json:"load_type" gorm:"column:load_type" description:"负载类型 0=http 1=tcp 2=grpc"` ServiceName string `json:"service_name" gorm:"column:service_name" description:"服务名称"` ServiceDesc string `json:"service_desc" gorm:"column:service_desc" description:"服务描述"` UpdatedAt time.Time `json:"create_at" gorm:"column:create_at" description:"更新时间"` CreatedAt time.Time `json:"update_at" gorm:"column:update_at" description:"添加时间"` IsDelete int8 `json:"is_delete" gorm:"column:is_delete" description:"是否已删除;0:否;1:是"` }
func (*ServiceInfo) Find ¶
func (t *ServiceInfo) Find(c *gin.Context, tx *gorm.DB, search *ServiceInfo) (*ServiceInfo, error)
func (*ServiceInfo) GroupByLoadType ¶
func (t *ServiceInfo) GroupByLoadType(c *gin.Context, tx *gorm.DB) ([]model.DashServiceStatItemOutput, error)
func (*ServiceInfo) PageList ¶
func (t *ServiceInfo) PageList(c *gin.Context, tx *gorm.DB, param *model.ServiceListInput) ([]ServiceInfo, int64, error)
func (*ServiceInfo) ServiceDetail ¶
func (t *ServiceInfo) ServiceDetail(c *gin.Context, tx *gorm.DB, search *ServiceInfo) (*ServiceDetail, error)
func (*ServiceInfo) TableName ¶
func (t *ServiceInfo) TableName() string
Click to show internal directories.
Click to hide internal directories.