wing

package
v0.0.0-...-ac7d4c8 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component struct {
	*bird.Bird
}

func New

func New(b *bird.Bird) *Component

func (*Component) Config

func (this *Component) Config() bird.ConfigInterface

func (*Component) LogDomain

func (this *Component) LogDomain() *logDomain

func (*Component) Login

func (this *Component) Login(username, password string) bool

登录

func (*Component) Models

func (this *Component) Models() []bird.ModelInterface

func (*Component) NewLog

func (this *Component) NewLog() *logModel

func (*Component) NewQueue

func (this *Component) NewQueue() *queueModel

创建模型

func (*Component) QueueDomain

func (this *Component) QueueDomain() *queueDomain

初始化域

type Config

type Config struct {
	CrossOpen     bool          `name:"是否允许跨域访问"`
	Route         string        `name:"管理路由" desc:"重启后生效"`
	UseDashboard  bool          `name:"是否启用管理面板" desc:"默认启用"`
	Username      string        `name:"管理账号" desc:"登录账号为字母数字组合" valid:"account:登录账号为字母数字组合"`
	Password      string        `` /* 185-byte string literal not displayed */
	LogLevel      int           `name:"日志保存等级" mode:"single" options:"1:调试 2:记录 3:警告 4:致命" desc:"超过该等级才保存日志"`
	LogSaveDays   int           `name:"日志保存天数" desc:"超过后将自动清理" valid:"lte=30,gte=1:日志可保存时间为1-30天"`
	SignConfig    SignConfig    `name:"签名认证" desc:"采用Sha256加密,判断Sha256(token,secret)==sign,重启后生效"`
	VisitConfig   VisitConfig   `name:"访问限制" desc:"重启生效"`
	SessionConfig SessionConfig `name:"session配置" desc:"重启生效"`
	WhiteIP       []string      `name:"控制台访问IP白名单" desc:"重启生效"`
}

func (*Config) Alias

func (this *Config) Alias() string

配置别名

func (*Config) Default

func (this *Config) Default() bird.ConfigInterface

默认配置

func (*Config) Name

func (this *Config) Name() string

配置名称

func (*Config) Validate

func (this *Config) Validate() error

type LogFindParams

type LogFindParams struct {
	Msg       string //
	BirdId    int64  //鸟
	BeginTime string //开始时间
	OverTime  string //结束时间
	BirdClass int    //鸟类型
	BirdName  string //鸟名
	Level     string //等级
	Handler   string //操作者
	IP        string //操作ip
}

日志查询参数

type LogModel

type LogModel struct {
	Id         int64
	BirdId     int64     `xorm:"bigint(20)"`         //保证是一个请求发起的
	ModuleName string    `xorm:"varchar(32) index"`  //模块名称
	BirdClass  int       `xorm:"tinyint(4) index"`   //鸟类
	BirdName   string    `xorm:"varchar(255) index"` //鸟名
	Msg        string    `xorm:"varchar(255) index"` //日志消息
	Level      int       `xorm:"tinyint(4) index"`   //日志等级
	Handler    string    `xorm:"varchar(32) index"`  //操作人
	Stack      string    `xorm:"text"`               //日志堆栈
	IP         string    `xorm:"varchar(32) index"`  //操作ip
	Data       string    `xorm:"text"`               //日志数据
	CreatedAt  time.Time `xorm:"created datetime"`
}

日志结构

type QueueModel

type QueueModel struct {
	Id         int64
	QueueAlias string    `xorm:"varchar(64)"` //队列别名
	Arg        string    `xorm:"text"`        //参数
	Err        string    `xorm:"text"`        //错误数据
	CreatedAt  time.Time `xorm:"created datetime"`
	UpdatedAt  time.Time `xorm:"updated datetime"`
	Version    int       `xorm:"version"`
}

队列数据库模型

type SessionConfig

type SessionConfig struct {
	SessionName   string `name:"session名称" desc:"默认BIRD-ID"`
	MaxAge        int    `name:"session会话有效时长" desc:"单位:秒"`
	UseRedis      bool   `name:"是否启用reids" desc:"默认使用内存"`
	RedisHost     string `name:"redis服务器地址" desc:""`
	RedisPassword string `name:"redis服务器密码"`
	RedisDB       string `name:"redis数据库号"`
}

type SignConfig

type SignConfig struct {
	Open       bool   `name:"是否启用" desc:"默认不启用"`
	SignName   string `name:"签名Head头key值" desc:"默认Sign,长度为80字符"`
	SignSecret string `name:"-" desc:""`
}

签名中间件配置

type VisitConfig

type VisitConfig struct {
	MaxConnect      int   `name:"最大访问量" desc:"小于1则不限制,默认0"`
	RepeatCheckTime int64 `name:"重复提交检测时间" desc:"单位:秒,小于1则不限制,默认0"`
}

访问配置

Jump to

Keyboard shortcuts

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