model

package
v0.0.0-...-426aaea Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

func (ac *AccessControl) Find(db *gorm.DB) error

func (*AccessControl) Save

func (ac *AccessControl) Save(db *gorm.DB) error

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

func (admin *Admin) CheckPassword(password string) bool

func (*Admin) Find

func (admin *Admin) Find(db *gorm.DB) error

func (*Admin) TableName

func (admin *Admin) TableName() string

func (*Admin) Update

func (admin *Admin) Update(db *gorm.DB) error

type GrpcRule

type GrpcRule struct {
	ID             uint   `json:"id" gorm:"primaryKey"`
	ServiceID      uint   `json:"service_id" gorm:"index;column:service_id"`
	Port           int    `json:"port" gorm:"column:port"`
	HeaderTransfer string `json:"header_transfer" gorm:"column:header_transfer"`
}

func (*GrpcRule) Find

func (rule *GrpcRule) Find(db *gorm.DB) error

func (*GrpcRule) Save

func (rule *GrpcRule) Save(db *gorm.DB) error

func (*GrpcRule) TableName

func (rule *GrpcRule) TableName() string

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"`
}

func (*HttpRule) Find

func (rule *HttpRule) Find(db *gorm.DB) error

func (*HttpRule) Save

func (rule *HttpRule) Save(db *gorm.DB) error

func (*HttpRule) TableName

func (rule *HttpRule) TableName() string

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

func (lb *LoadBalance) Find(db *gorm.DB) error

func (*LoadBalance) GetIPList

func (lb *LoadBalance) GetIPList() []string

func (*LoadBalance) GetWeightList

func (lb *LoadBalance) GetWeightList() []string

func (*LoadBalance) Save

func (lb *LoadBalance) Save(db *gorm.DB) error

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

func (si *ServiceInfo) Find(db *gorm.DB) error

func (*ServiceInfo) PageList

func (si *ServiceInfo) PageList(db *gorm.DB, info string, pageNo, pageSize int) ([]*ServiceInfo, int, error)

func (*ServiceInfo) Save

func (si *ServiceInfo) Save(db *gorm.DB) error

func (*ServiceInfo) ServiceDetail

func (si *ServiceInfo) ServiceDetail(db *gorm.DB) (*ServiceDetail, error)

func (*ServiceInfo) TableName

func (si *ServiceInfo) TableName() string

type TcpRule

type TcpRule struct {
	ID        uint `json:"id" gorm:"primaryKey"`
	ServiceID uint `json:"service_id" gorm:"index;column:service_id"`
	Port      int  `json:"port" gorm:"column:port"`
}

func (*TcpRule) Find

func (rule *TcpRule) Find(db *gorm.DB) error

func (*TcpRule) Save

func (rule *TcpRule) Save(db *gorm.DB) error

func (*TcpRule) TableName

func (rule *TcpRule) TableName() string

Jump to

Keyboard shortcuts

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