models

package
v0.0.0-...-701726f Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: EPL-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppModel = &Application{}

AppModel 暴露自身,让外部能调用绑定方法

View Source
var CrossDomainModel = &CrossDomain{}

CrossDomainModel 暴露自身,让外部能调用绑定方法

View Source
var OverloadModel = &Overload{}

OverloadModel 暴露自身,让外部能调用绑定方法

View Source
var RouteModel = &Route{}

RouteModel 暴露自身,让外部能调用绑定方法

Functions

func QueryAllActiveRoutes

func QueryAllActiveRoutes() (map[string]Route, error)

QueryAllActiveRoutes ORM操作

Types

type Application

type Application struct {
	Id         int    `orm:"column(id);pk" json:"id"`
	AppId      string `orm:"column(app_id)" json:"app_id"`         //应用ID
	Name       string `orm:"column(name)" json:"name"`             //应用名称
	Remark     string `orm:"column(remark)" json:"remark"`         //应用描述
	CrossMode  int    `orm:"column(cross_mode)" json:"cross_mode"` //跨域模式:0-禁止,1-允许,2-配置
	AuthMode   int    `orm:"column(auth_mode)" json:"auth_mode"`   //鉴权模式:0-不鉴权,1-报头,2-URL
	AuthCode   string `orm:"column(auth_code)" json:"auth_code"`   //鉴权码
	State      int    `orm:"column(state)" json:"state"`           //1:启用,0:禁用
	UpdateTime string `orm:"column(update_time)" json:"update_time"`
	CreateTime string `orm:"column(create_time)" json:"create_time"`
}

Application 过载配置表

func QueryAllActiveApp

func QueryAllActiveApp() ([]Application, error)

QueryAllActiveApp ORM操作

func (*Application) IsExistApp

func (t *Application) IsExistApp(appId string) bool

func (*Application) QueryAllActiveApp

func (t *Application) QueryAllActiveApp() ([]Application, error)

QueryAllActiveApp ORM操作

func (*Application) TableName

func (t *Application) TableName() string

type CrossDomain

type CrossDomain struct {
	Id         int    `orm:"column(id);pk" json:"id"`
	AppId      string `orm:"column(app_id)" json:"app_id"`     //应用ID
	RouteId    int    `orm:"column(route_id)" json:"route_id"` //路由id:0-全局
	Origin     string `orm:"column(origin)" json:"origin"`     //来源域名链接
	Remark     string `orm:"column(remark)" json:"remark"`     //描述
	State      int    `orm:"column(state)" json:"state"`       //1:启用,0:禁用
	UpdateTime string `orm:"column(update_time)" json:"update_time"`
	CreateTime string `orm:"column(create_time)" json:"create_time"`
}

CrossDomain 跨域白名单

func QueryAllActiveDomains

func QueryAllActiveDomains() ([]CrossDomain, error)

QueryAllActiveDomains ORM操作

func (*CrossDomain) TableName

func (t *CrossDomain) TableName() string

type Overload

type Overload struct {
	Id         int    `orm:"column(id);pk" json:"id"`
	AppId      string `orm:"column(app_id)" json:"app_id"`     //应用ID
	UrlPath    string `orm:"column(url_path)" json:"url_path"` //请求路径,建议:/appName/module/action
	Limit      int    `orm:"column(limit)" json:"limit"`       //限制次数
	Interval   int    `orm:"column(interval)" json:"interval"` //间隔时间,单位秒
	Remark     string `orm:"column(remark)" json:"remark"`     //请求路径描述
	State      int    `orm:"column(state)" json:"state"`       //1:启用,0:禁用
	UpdateTime string `orm:"column(update_time)" json:"update_time"`
	CreateTime string `orm:"column(create_time)" json:"create_time"`
}

Overload 过载配置表

func (*Overload) TableName

func (t *Overload) TableName() string

type Route

type Route struct {
	Id         int    `orm:"column(id);pk" json:"id"`
	AppId      string `orm:"column(app_id)" json:"app_id"`         //应用ID
	UrlPath    string `orm:"column(url_path)" json:"url_path"`     //请求路径,建议:/appName/module/action
	ServiceUrl string `orm:"column(service_url)" json:"service"`   //下游Url,支持eureka模式和域名、ip端口模式
	RateLimit  int    `orm:"column(rate_limit)" json:"rate_limit"` //频率限制,每秒次数
	Timeout    int    `orm:"column(timeout)" json:"timeout"`       //超时时间,单位秒
	RspMode    int    `orm:"column(rsp_mode)" json:"rsp_mode"`     //应答模式:0-明文,1-加密
	CrossMode  int    `orm:"column(cross_mode)" json:"cross_mode"` //跨域模式:0-禁止,1-允许,2-配置
	Remark     string `orm:"column(remark)" json:"remark"`         //请求路径描述
	State      int    `orm:"column(state)" json:"state"`           //1:启用,0:禁用
	UpdateTime string `orm:"column(update_time)" json:"update_time"`
	CreateTime string `orm:"column(create_time)" json:"create_time"`
}

Route 定义模型结构体,属性大写开头表示public权限,小写为私有 服务路由映射表

func (*Route) TableName

func (t *Route) TableName() string

type RouteConf

type RouteConf struct {
	Id         int    `orm:"column(id);pk" json:"id"`
	AppId      string `orm:"column(app_id)" json:"app_id"`         //应用ID
	UrlPath    string `orm:"column(url_path)" json:"url_path"`     //请求路径,建议:/appName/module/action
	ServiceUrl string `orm:"column(service_url)" json:"service"`   //下游Url,支持eureka模式和域名、ip端口模式
	RateLimit  int    `orm:"column(rate_limit)" json:"rate_limit"` //频率限制,每秒次数
	Timeout    int    `orm:"column(timeout)" json:"timeout"`       //超时时间,单位秒
	RspMode    int    `orm:"column(rsp_mode)" json:"rsp_mode"`     //应答模式:0-明文,1-加密
	CrossMode  int    `orm:"column(cross_mode)" json:"cross_mode"` //跨域模式:0-禁止,1-允许,2-配置
	Limit      int    `orm:"column(limit)" json:"limit"`           //限制次数
	Interval   int    `orm:"column(interval)" json:"interval"`     //间隔时间,单位秒
}

RouteConf 服务路由配置

func QueryAllActiveRouteConfMap

func QueryAllActiveRouteConfMap() ([]RouteConf, error)

QueryAllActiveRouteConfMap ORM操作

Jump to

Keyboard shortcuts

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