Documentation ¶
Index ¶
- func MigrationTable()
- type AccessControl
- type Admin
- type GrpcRule
- type HttpRule
- type LoadBalance
- type ServiceDetail
- type ServiceInfo
- func (si *ServiceInfo) Find(db *gorm.DB) error
- func (si *ServiceInfo) PageList(db *gorm.DB, info string, pageNo, pageSize int) ([]*ServiceInfo, int, error)
- func (si *ServiceInfo) Save(db *gorm.DB) error
- func (si *ServiceInfo) ServiceDetail(db *gorm.DB) (*ServiceDetail, error)
- func (si *ServiceInfo) TableName() string
- type TcpRule
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrationTable ¶
func MigrationTable()
Types ¶
type AccessControl ¶
type AccessControl struct { ID uint `json:"id" gorm:"primaryKey"` ServiceID uint `json:"service_id" gorm:"index;column:service_id"` EnableAuth int `json:"enable_auth" gorm:"column:enable_auth"` BlackList string `json:"black_list" gorm:"column:black_list"` WhiteList string `json:"white_list" gorm:"column:white_list"` ClientIPFlowLimit int `json:"clientip_flow_limit" gorm:"column:clientip_flow_limit"` ServiceFlowLimit int `json:"service_flow_limit" gorm:"column:service_flow_limit"` }
func (*AccessControl) TableName ¶
func (ac *AccessControl) TableName() string
type Admin ¶
type Admin struct { ID uint `gorm:"primaryKey"` Username string `gorm:"index;size:20;column:user_name;not null"` Password string `gorm:"not null"` Salt string CreatedAt time.Time UpdatedAt time.Time IsDelete int `gorm:"column:is_delete"` }
func (*Admin) CheckPassword ¶
type GrpcRule ¶
type HttpRule ¶
type HttpRule struct { ID uint `json:"id" gorm:"primaryKey"` ServiceID uint `json:"service_id" gorm:"index;column:service_id"` RuleType int `json:"rule_type" gorm:"column:rule_type"` Rule string `json:"rule" gorm:"column:rule"` NeedHttps int `json:"need_https" gorm:"column:need_https"` NeedStripUri int `json:"need_strip_uri" gorm:"column:need_strip_uri"` UrlRewrite string `json:"url_rewrite" gorm:"column:url_rewrite"` HeaderTransfer string `json:"header_transfer" gorm:"column:header_transfer"` }
type LoadBalance ¶
type LoadBalance struct { ID uint `json:"id" gorm:"primaryKey"` ServiceID uint `json:"service_id" gorm:"index;column:service_id"` RoundType int `json:"round_type" gorm:"column:round_type"` IpList string `json:"ip_list" gorm:"column:ip_list"` WeightList string `json:"weight_list" gorm:"column:weight_list"` UpstreamConnectTimeout int `json:"upstream_connect_timeout" gorm:"column:upstream_connect_timeout"` UpstreamHeaderTimeout int `json:"upstream_header_timeout" gorm:"column:upstream_header_timeout"` UpstreamIdleTimeout int `json:"upstream_idle_timeout" gorm:"column:upstream_idle_timeout"` UpstreamMaxIdle int `json:"upstream_max_idle" gorm:"column:upstream_max_idle"` }
func (*LoadBalance) GetIPList ¶
func (lb *LoadBalance) GetIPList() []string
func (*LoadBalance) GetWeightList ¶
func (lb *LoadBalance) GetWeightList() []string
func (*LoadBalance) TableName ¶
func (lb *LoadBalance) TableName() string
type ServiceDetail ¶
type ServiceDetail struct { Info *ServiceInfo `json:"info"` HTTPRule *HttpRule `json:"http_rule"` TCPRule *TcpRule `json:"tcp_rule"` GRPCRule *GrpcRule `json:"grpc_rule"` LoadBalance *LoadBalance `json:"load_balance"` AccessControl *AccessControl `json:"access_control"` }
type ServiceInfo ¶
type ServiceInfo struct { ID uint `json:"id" gorm:"primaryKey"` LoadType int `json:"load_type" gorm:"column:load_type" description:"0=http 1=tcp 2=grpc"` ServiceName string `json:"service_name" gorm:"index;not null;size:130;column:service_name"` ServiceDesc string `json:"service_desc" gorm:"column:service_desc"` UpdatedAt time.Time `json:"updated_at"` CreatedAt time.Time `json:"created_at"` IsDelete int8 `json:"is_delete" gorm:"column:is_delete"` }
func (*ServiceInfo) PageList ¶
func (si *ServiceInfo) PageList(db *gorm.DB, info string, pageNo, pageSize int) ([]*ServiceInfo, int, error)
func (*ServiceInfo) ServiceDetail ¶
func (si *ServiceInfo) ServiceDetail(db *gorm.DB) (*ServiceDetail, error)
func (*ServiceInfo) TableName ¶
func (si *ServiceInfo) TableName() string
Click to show internal directories.
Click to hide internal directories.