Documentation ¶
Index ¶
- func Database(connString string) error
- func NewDBClient(ctx context.Context) *gorm.DB
- type AccessControl
- type AccessControlDao
- func (d *AccessControlDao) Delete(ID int64) error
- func (d *AccessControlDao) Find(search *AccessControl) (*AccessControl, error)
- func (d *AccessControlDao) ListBYServiceID(c *gin.Context, tx *gorm.DB, serviceID int64) ([]AccessControl, int64, error)
- func (d *AccessControlDao) Save(accessControl *AccessControl) error
- type Admin
- type AdminDao
- type App
- type AppDao
- type HttpRule
- type HttpRuleDao
- type LoadBalance
- type LoadBalanceDao
- type Node
- type NodeDao
- type ServiceDetail
- type ServiceInfo
- type ServiceInfoDao
- func (d *ServiceInfoDao) Delete(ID int64) error
- func (d *ServiceInfoDao) Find(search *ServiceInfo) (*ServiceInfo, error)
- func (d *ServiceInfoDao) GroupByProtocolType() ([]dto.DashServiceStatItemOutput, error)
- func (d *ServiceInfoDao) PageList(param *dto.ServiceListInput) ([]ServiceInfo, int64, error)
- func (d *ServiceInfoDao) Save(serviceInfo *ServiceInfo) error
- func (d *ServiceInfoDao) ServiceDetail(c *gin.Context, search *ServiceInfo) (*ServiceDetail, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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"` 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) TableName ¶
func (t *AccessControl) TableName() string
type AccessControlDao ¶
func NewAccessControlDao ¶
func NewAccessControlDao(ctx context.Context, db ...*gorm.DB) *AccessControlDao
func (*AccessControlDao) Delete ¶
func (d *AccessControlDao) Delete(ID int64) error
func (*AccessControlDao) Find ¶
func (d *AccessControlDao) Find(search *AccessControl) (*AccessControl, error)
func (*AccessControlDao) ListBYServiceID ¶
func (d *AccessControlDao) ListBYServiceID(c *gin.Context, tx *gorm.DB, serviceID int64) ([]AccessControl, int64, error)
func (*AccessControlDao) Save ¶
func (d *AccessControlDao) Save(accessControl *AccessControl) error
type Admin ¶
type Admin struct { Id int `json:"id" gorm:"primary_key" description:"自增主键"` UserName string `json:"user_name" gorm:"column:user_name" 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 AdminDao ¶
func NewAdminDao ¶
type App ¶
type App struct { ID int64 `json:"id" gorm:"primary_key"` AccessKey string `json:"access_key" gorm:"column:access_key" description:"租户key "` Name string `json:"name" gorm:"column:name" description:"租户名称"` SecretKey string `json:"secret_key" gorm:"column:secret_key" description:"密钥"` 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 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前缀"` 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 */ }
type HttpRuleDao ¶
func NewHttpRuleDao ¶
func NewHttpRuleDao(ctx context.Context, db ...*gorm.DB) *HttpRuleDao
func (*HttpRuleDao) Delete ¶
func (d *HttpRuleDao) Delete(ID int64) error
func (*HttpRuleDao) ListByServiceID ¶
func (d *HttpRuleDao) ListByServiceID(serviceID int64) ([]HttpRule, int64, error)
func (*HttpRuleDao) Save ¶
func (d *HttpRuleDao) Save(httpRule *HttpRule) error
type LoadBalance ¶
type LoadBalance struct { ID int64 `json:"id" gorm:"primary_key"` ServiceID int64 `json:"service_id" gorm:"column:service_id" description:"服务id "` RoundType int `json:"round_type" gorm:"column:round_type" description:"轮询方式 round/weight_round/random/ip_hash"` ProxyName string `json:"proxy_name" gorm:"column:proxy_name" description:"被代理服务名"` 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) TableName ¶
func (t *LoadBalance) TableName() string
type LoadBalanceDao ¶
func NewLoadBalanceDao ¶
func NewLoadBalanceDao(ctx context.Context, db ...*gorm.DB) *LoadBalanceDao
func (*LoadBalanceDao) Delete ¶
func (d *LoadBalanceDao) Delete(ID int64) error
func (*LoadBalanceDao) Find ¶
func (d *LoadBalanceDao) Find(search *LoadBalance) (*LoadBalance, error)
func (*LoadBalanceDao) Save ¶
func (d *LoadBalanceDao) Save(loadBalance *LoadBalance) error
type Node ¶
type Node struct { ID int64 `json:"id" gorm:"primary_key"` Name string `json:"name" gorm:"column:name" description:"节点名称"` Status string `json:"status" gorm:"column:status" description:"节点状态"` CreatedAt time.Time `json:"create_at" gorm:"column:create_at" description:"添加时间"` UpdateAt time.Time `json:"update_at" gorm:"column:update_at" description:"修改时间"` InternalIP string `json:"internal_ip" gorm:"column:internal_ip" description:"内网IP"` ExternalIP string `json:"external_ip" gorm:"column:external_ip" description:"外网IP"` Info string `json:"info" gorm:"column:info" description:"节点信息,json格式"` Containers string `json:"containers" gorm:"column:containers" description:"容器信息,json格式"` }
Node 结构体用于表示 node 表的行数据
type ServiceDetail ¶
type ServiceDetail struct { Info *ServiceInfo `json:"info" description:"基本信息"` HTTPRule *HttpRule `json:"http_rule" description:"http_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"` ProtocolType int `json:"protocol_type" gorm:"column:protocol_type" description:"协议类型 0=http 1=https 2=websocket 3=tcp 4=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:"添加时间"` }
func (*ServiceInfo) TableName ¶
func (t *ServiceInfo) TableName() string
type ServiceInfoDao ¶
func NewServiceInfoDao ¶
func NewServiceInfoDao(ctx context.Context, db ...*gorm.DB) *ServiceInfoDao
func (*ServiceInfoDao) Delete ¶
func (d *ServiceInfoDao) Delete(ID int64) error
func (*ServiceInfoDao) Find ¶
func (d *ServiceInfoDao) Find(search *ServiceInfo) (*ServiceInfo, error)
func (*ServiceInfoDao) GroupByProtocolType ¶
func (d *ServiceInfoDao) GroupByProtocolType() ([]dto.DashServiceStatItemOutput, error)
func (*ServiceInfoDao) PageList ¶
func (d *ServiceInfoDao) PageList(param *dto.ServiceListInput) ([]ServiceInfo, int64, error)
func (*ServiceInfoDao) Save ¶
func (d *ServiceInfoDao) Save(serviceInfo *ServiceInfo) error
func (*ServiceInfoDao) ServiceDetail ¶
func (d *ServiceInfoDao) ServiceDetail(c *gin.Context, search *ServiceInfo) (*ServiceDetail, error)
Click to show internal directories.
Click to hide internal directories.