Documentation
¶
Index ¶
- type APPConfiger
- type GatewayAPP
- func (o *GatewayAPP) Del(db *gorm.DB) error
- func (o *GatewayAPP) FindByAppID(db *gorm.DB, appID string) (*GatewayAPP, error)
- func (o *GatewayAPP) FindByID(db *gorm.DB, id int64) (*GatewayAPP, error)
- func (o *GatewayAPP) GetAll(orders ...string) ([]*GatewayAPP, error)
- func (o *GatewayAPP) GetPk() int64
- func (o *GatewayAPP) Save(db *gorm.DB) error
- func (o *GatewayAPP) TableName() string
- type GatewayAccessControl
- func (o *GatewayAccessControl) Del(db *gorm.DB) error
- func (o *GatewayAccessControl) GetAll() ([]*GatewayAccessControl, error)
- func (o *GatewayAccessControl) GetByModule(moduleID int64) (*GatewayAccessControl, error)
- func (o *GatewayAccessControl) GetPk() int64
- func (o *GatewayAccessControl) Save(db *gorm.DB) error
- func (o *GatewayAccessControl) TableName() string
- type GatewayLoadBalance
- func (o *GatewayLoadBalance) Del(db *gorm.DB) error
- func (o *GatewayLoadBalance) GetAll() ([]*GatewayLoadBalance, error)
- func (o *GatewayLoadBalance) GetByModule(moduleID int64) (*GatewayLoadBalance, error)
- func (o *GatewayLoadBalance) GetPk() int64
- func (o *GatewayLoadBalance) Save(db *gorm.DB) error
- func (o *GatewayLoadBalance) TableName() string
- type GatewayMatchRule
- func (o *GatewayMatchRule) Del(db *gorm.DB) error
- func (o *GatewayMatchRule) FindByURLPrefix(db *gorm.DB, prefix string) (*GatewayMatchRule, error)
- func (o *GatewayMatchRule) GetAll() ([]*GatewayMatchRule, error)
- func (o *GatewayMatchRule) GetByModule(moduleID int64) ([]*GatewayMatchRule, error)
- func (o *GatewayMatchRule) GetPk() int64
- func (o *GatewayMatchRule) Save(db *gorm.DB) error
- func (o *GatewayMatchRule) TableName() string
- type GatewayModule
- type GatewayModuleBase
- func (o *GatewayModuleBase) Del(db *gorm.DB) error
- func (o *GatewayModuleBase) FindByName(db *gorm.DB, name string) (*GatewayModuleBase, error)
- func (o *GatewayModuleBase) FindByPort(db *gorm.DB, port string) (*GatewayModuleBase, error)
- func (o *GatewayModuleBase) GetAll(orders ...string) ([]*GatewayModuleBase, error)
- func (o *GatewayModuleBase) GetPk() int64
- func (o *GatewayModuleBase) Save(db *gorm.DB) error
- func (o *GatewayModuleBase) TableName() string
- type ModuleConfiger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APPConfiger ¶
type APPConfiger struct {
AuthirizedApps []*GatewayAPP `json:"authirized_apps" toml:"authirized_apps" validate:"required"`
}
APPConfiger app列表配置
type GatewayAPP ¶
type GatewayAPP struct { ID int64 `json:"id" toml:"-" orm:"column(id);auto" description:"自增主键"` AppID string `json:"app_id" toml:"app_id" validate:"required" orm:"column(app_id);" description:"�租户id"` Name string `json:"name" toml:"name" validate:"required" orm:"column(name);" description:"租户名称"` Secret string `json:"secret" toml:"secret" validate:"required" orm:"column(secret);" description:"密钥"` Method string `json:"method" toml:"method" validate:"" orm:"column(method);" descriId int6ption:"请求方法"` Timeout int64 `json:"timeout" toml:"timeout" orm:"column(timeout);" description:"超时时间"` OpenAPI string `json:"open_api" toml:"open_api" orm:"column(open_api);" description:"接口列表,支持前缀匹配"` WhiteIps string `json:"white_ips" toml:"white_ips" orm:"column(white_ips);" description:"ip白名单,支持前缀匹配"` CityIDs string `json:"city_ids" toml:"city_ids" orm:"column(city_ids);" description:"city_id数据权限"` TotalQueryDaily int64 `json:"total_query_daily" toml:"total_query_daily" orm:"column(total_query_daily);" description:"日请求量"` QPS int64 `json:"qps" toml:"qps" orm:"column(qps);" description:"qps"` GroupID int64 `json:"group_id" toml:"group_id" orm:"column(group_id);" description:"数据关联id"` }
GatewayAPP app配置
func (*GatewayAPP) FindByAppID ¶
func (o *GatewayAPP) FindByAppID(db *gorm.DB, appID string) (*GatewayAPP, error)
FindByAppID db findbyappid
func (*GatewayAPP) FindByID ¶
func (o *GatewayAPP) FindByID(db *gorm.DB, id int64) (*GatewayAPP, error)
FindByID db findbyid
func (*GatewayAPP) GetAll ¶
func (o *GatewayAPP) GetAll(orders ...string) ([]*GatewayAPP, error)
GetAll db getall
type GatewayAccessControl ¶
type GatewayAccessControl struct { ID int64 `json:"id" toml:"-" orm:"column(id);auto" description:"自增主键"` ModuleID int64 `json:"module_id" toml:"-" orm:"column(module_id)" description:"�模块id"` BlackList string `json:"black_list" toml:"black_list" orm:"column(black_list);size(1000)" description:"黑名单ip"` WhiteList string `json:"white_list" toml:"white_list" orm:"column(white_list);size(1000)" description:"白名单ip"` WhiteHostName string `json:"white_host_name" toml:"white_host_name" orm:"column(white_host_name);size(1000)" description:"白名单主机"` AuthType string `json:"auth_type" toml:"auth_type" orm:"column(auth_type);size(100)" description:"认证方法"` ClientFlowLimit int64 `json:"client_flow_limit" toml:"client_flow_limit" orm:"column(client_flow_limit);size(100)" description:"�客户端ip限流"` Open int64 `json:"open" toml:"open" orm:"column(open);size(100)" description:"是否开启权限功能"` }
GatewayAccessControl access_control 数据表结构体
func (*GatewayAccessControl) GetAll ¶
func (o *GatewayAccessControl) GetAll() ([]*GatewayAccessControl, error)
GetAll getall
func (*GatewayAccessControl) GetByModule ¶
func (o *GatewayAccessControl) GetByModule(moduleID int64) (*GatewayAccessControl, error)
GetByModule getbymoduleid
func (*GatewayAccessControl) Save ¶
func (o *GatewayAccessControl) Save(db *gorm.DB) error
Save db save
func (*GatewayAccessControl) TableName ¶
func (o *GatewayAccessControl) TableName() string
TableName tablename
type GatewayLoadBalance ¶
type GatewayLoadBalance struct { ID int64 `json:"id" toml:"-" orm:"column(id);auto" description:"自增主键"` ModuleID int64 `json:"module_id" toml:"-" orm:"column(module_id)"` CheckMethod string `json:"check_method" validate:"required" toml:"check_method" orm:"column(check_method);size(200)" description:"检查方法"` CheckURL string `json:"check_url" validate:"" toml:"check_url" orm:"column(check_url);size(500)" description:"检测url"` CheckTimeout int `` /* 140-byte string literal not displayed */ CheckInterval int `` /* 134-byte string literal not displayed */ Type string `json:"type" validate:"required" toml:"type" orm:"column(type);size(100)" description:"轮询方式"` IPList string `json:"ip_list" validate:"required" toml:"ip_list" orm:"column(ip_list);size(500)" description:"ip列表"` WeightList string `json:"weight_list" validate:"" toml:"weight_list" orm:"column(weight_list);size(500)" description:"ip列表"` ForbidList string `json:"forbid_list" validate:"" toml:"forbid_list" orm:"column(forbid_list);size(1000)" description:"禁用 ip列表"` ProxyConnectTimeout int `` /* 169-byte string literal not displayed */ ProxyHeaderTimeout int `` /* 161-byte string literal not displayed */ ProxyBodyTimeout int `` /* 149-byte string literal not displayed */ MaxIdleConn int `json:"max_idle_conn" validate:"" toml:"max_idle_conn" orm:"column(max_idle_conn)"` IdleConnTimeout int `` /* 140-byte string literal not displayed */ }
GatewayLoadBalance load_balance数据表结构体
func (*GatewayLoadBalance) GetAll ¶
func (o *GatewayLoadBalance) GetAll() ([]*GatewayLoadBalance, error)
GetAll db getall
func (*GatewayLoadBalance) GetByModule ¶
func (o *GatewayLoadBalance) GetByModule(moduleID int64) (*GatewayLoadBalance, error)
GetByModule db getbymoduleid
func (*GatewayLoadBalance) TableName ¶
func (o *GatewayLoadBalance) TableName() string
TableName tablename
type GatewayMatchRule ¶
type GatewayMatchRule struct { ID int64 `json:"id" toml:"-" orm:"column(id);auto" description:"自增主键"` ModuleID int64 `json:"module_id" toml:"-" orm:"column(module_id)" description:"��模块id"` Type string `json:"type" toml:"type" validate:"required" orm:"column(type)" description:"匹配类型"` Rule string `json:"rule" toml:"rule" validate:"required" orm:"column(rule);size(1000)" description:"规则"` RuleExt string `json:"rule_ext" validate:"required" toml:"rule_ext" orm:"column(rule_ext);size(1000)" description:"拓展规则"` URLRewrite string `json:"url_rewrite" validate:"required" toml:"url_rewrite" orm:"column(rule_ext);size(1000)" description:"url重写"` }
GatewayMatchRule match_rule数据表结构体
func (*GatewayMatchRule) FindByURLPrefix ¶
func (o *GatewayMatchRule) FindByURLPrefix(db *gorm.DB, prefix string) (*GatewayMatchRule, error)
FindByURLPrefix db findbyprefix
func (*GatewayMatchRule) GetAll ¶
func (o *GatewayMatchRule) GetAll() ([]*GatewayMatchRule, error)
GetAll db getall
func (*GatewayMatchRule) GetByModule ¶
func (o *GatewayMatchRule) GetByModule(moduleID int64) ([]*GatewayMatchRule, error)
GetByModule db getmodule
func (*GatewayMatchRule) TableName ¶
func (o *GatewayMatchRule) TableName() string
TableName tablename
type GatewayModule ¶
type GatewayModule struct { Base *GatewayModuleBase `json:"base" validate:"required" toml:"base"` MatchRule []*GatewayMatchRule `json:"match_rule" validate:"required" toml:"match_rule"` LoadBalance *GatewayLoadBalance `json:"load_balance" validate:"required" toml:"load_balance"` AccessControl *GatewayAccessControl `json:"access_control" toml:"access_control"` }
GatewayModule module配置
type GatewayModuleBase ¶
type GatewayModuleBase struct { ID int64 `json:"id" toml:"-" orm:"column(id);auto" description:"自增主键"` LoadType string `json:"load_type" toml:"load_type" validate:"" orm:"column(load_type);size(255)" description:"负载类型 http/tcp"` Name string `json:"name" toml:"name" validate:"required" orm:"column(name);size(255)" description:"模块名"` ServiceName string `json:"service_name" toml:"service_name" validate:"" orm:"column(service_name);size(255)" description:"服务名称"` PassAuthType int8 `json:"pass_auth_type" toml:"pass_auth_type" validate:"" orm:"column(pass_auth_type)" description:"认证传参类型"` FrontendAddr string `` /* 126-byte string literal not displayed */ }
GatewayModuleBase base数据表结构体
func (*GatewayModuleBase) FindByName ¶
func (o *GatewayModuleBase) FindByName(db *gorm.DB, name string) (*GatewayModuleBase, error)
FindByName db findbyname
func (*GatewayModuleBase) FindByPort ¶
func (o *GatewayModuleBase) FindByPort(db *gorm.DB, port string) (*GatewayModuleBase, error)
FindByPort db findbyport
func (*GatewayModuleBase) GetAll ¶
func (o *GatewayModuleBase) GetAll(orders ...string) ([]*GatewayModuleBase, error)
GetAll db getall
func (*GatewayModuleBase) TableName ¶
func (o *GatewayModuleBase) TableName() string
TableName db tablename
type ModuleConfiger ¶
type ModuleConfiger struct {
Module []*GatewayModule `json:"module" toml:"module" validate:"required"`
}
ModuleConfiger module整体配置结构
func (*ModuleConfiger) GetGateWayModule ¶
func (c *ModuleConfiger) GetGateWayModule(name string) *GatewayModule
GetGateWayModule 根据名字获取模块