dao

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

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) Del

func (o *GatewayAPP) Del(db *gorm.DB) error

Del db del

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

func (*GatewayAPP) GetPk

func (o *GatewayAPP) GetPk() int64

GetPk get pk

func (*GatewayAPP) Save

func (o *GatewayAPP) Save(db *gorm.DB) error

Save db save

func (*GatewayAPP) TableName

func (o *GatewayAPP) TableName() string

TableName db table

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) Del

func (o *GatewayAccessControl) Del(db *gorm.DB) error

Del db del

func (*GatewayAccessControl) GetAll

GetAll getall

func (*GatewayAccessControl) GetByModule

func (o *GatewayAccessControl) GetByModule(moduleID int64) (*GatewayAccessControl, error)

GetByModule getbymoduleid

func (*GatewayAccessControl) GetPk

func (o *GatewayAccessControl) GetPk() int64

GetPk getpk

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) Del

func (o *GatewayLoadBalance) Del(db *gorm.DB) error

Del db del

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) GetPk

func (o *GatewayLoadBalance) GetPk() int64

GetPk getpk

func (*GatewayLoadBalance) Save

func (o *GatewayLoadBalance) Save(db *gorm.DB) error

Save db save

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) Del

func (o *GatewayMatchRule) Del(db *gorm.DB) error

Del db del

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) GetPk

func (o *GatewayMatchRule) GetPk() int64

GetPk db get pk

func (*GatewayMatchRule) Save

func (o *GatewayMatchRule) Save(db *gorm.DB) error

Save db save

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) Del

func (o *GatewayModuleBase) Del(db *gorm.DB) error

Del db row

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) GetPk

func (o *GatewayModuleBase) GetPk() int64

GetPk getpk

func (*GatewayModuleBase) Save

func (o *GatewayModuleBase) Save(db *gorm.DB) error

Save db row

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 根据名字获取模块

Jump to

Keyboard shortcuts

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