model

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	gorm.Model
	Url        string   `gorm:"size:256"`
	Count      uint64   `gorm:"type:int"`
	IpInfoList []IpInfo `gorm:"many2many:ipinfo"`
}

type ApiModel

type ApiModel struct {
	// contains filtered or unexported fields
}

func NewApiModel

func NewApiModel(db *gorm.DB, rdb *redis.Client) *ApiModel

func (*ApiModel) CreateApi

func (a *ApiModel) CreateApi(api *Api) (id uint64, err error)

CreateApi 创建APiRouter

func (*ApiModel) GetApi

func (a *ApiModel) GetApi(id uint64) (*Api, error)

GetApi 根据ID获取Api信息

func (*ApiModel) GetApiByName

func (a *ApiModel) GetApiByName(url string) (*Api, error)

GetApiByName 根据Api.Router查找Api

type BadIp

type BadIp struct {
	gorm.Model
	Ip      string `gorm:"size:256"`
	Address string `gorm:"size:256"`
	Count   uint64 `gorm:"int"`
	PcMp    string `gorm:"size:256"`
}

BadIp 阻止IP

type BadIpRsp

type BadIpRsp struct {
	Ip      string `json:"ip"`
	PcMp    string `json:"pc_mp"`
	Address string `json:"address"`
}

type BadWords

type BadWords struct {
	gorm.Model
	Word  string `gorm:"size:256"`
	Count uint64 `gorm:"type:int"`
}

BadWords 敏感词

type HttpInfo

type HttpInfo struct {
	ClientIP string
	Method   string
	UrlPath  string
	Header   string
	// contains filtered or unexported fields
}

HttpInfo kafka 传进参数的Struct结构体

type IpInfo

type IpInfo struct {
	gorm.Model
	IpAddr  string `gorm:"index"`
	Count   uint64 `gorm:"type:int"`
	Url     string `gorm:"size:256"`
	ApiList []Api  `gorm:"many2many:api"`
}

type IpInfoModel

type IpInfoModel struct {
	// contains filtered or unexported fields
}

func NewIpInfoModel

func NewIpInfoModel(db *gorm.DB, rdb *redis.Client) *IpInfoModel

func (*IpInfoModel) CreateIpInfo

func (a *IpInfoModel) CreateIpInfo(info *IpInfo) (id uint64, err error)

CreateIpInfo 创建APiRouter

type User

type User struct {
	gorm.Model
	Username string `gorm:"size:32;unique_index"`
	Password string `gorm:"size:64;unique_index"`
}

type UserModel

type UserModel struct {
	// contains filtered or unexported fields
}

func NewUserModel

func NewUserModel(db *gorm.DB, rdb *redis.Client) *UserModel

Jump to

Keyboard shortcuts

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