Documentation
¶
Overview ¶
Package system 提供了大部分与事个系统相关的功能
Index ¶
- func DeleteLinkage(l *Module, key string) error
- func InstallLinkage[T any](l *Module, key, title string, items []*LinkageItem[T]) error
- type Backup
- type Config
- type Linkage
- func (l *Linkage[T]) Add(v T, parent int64) (*LinkageItem[T], error)
- func (l *Linkage[T]) Delete(id int64) error
- func (l *Linkage[T]) Get(id int64) *LinkageItem[T]
- func (l *Linkage[T]) Items() []*LinkageItem[T]
- func (l *Linkage[T]) Key() string
- func (l *Linkage[T]) Set(id int64, v T) error
- func (l *Linkage[T]) Title() string
- type LinkageItem
- type Module
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InstallLinkage ¶
func InstallLinkage[T any](l *Module, key, title string, items []*LinkageItem[T]) error
InstallLinkage 安装一组级联数据
Types ¶
type Backup ¶
type Backup struct {
// 备份文件的路径
Dir string `json:"dir" yaml:"dir" xml:"dir"`
// 备份的文件格式,以 Go 的时间格式作为格式。
Format string `json:"format" yaml:"format" xml:"format"`
// 备份任务的执行时间
Cron string `yaml:"cron" json:"cron" xml:"cron"`
// contains filtered or unexported fields
}
Backup 备份数据的相关设置项
func (*Backup) SanitizeConfig ¶
func (b *Backup) SanitizeConfig() *web.FieldError
type Config ¶
type Config struct {
// URLPrefix 该模块下的地址前缀
URLPrefix string `yaml:"urlPrefix" json:"urlPrefix" xml:"urlPrefix"`
// Backup 备份数据的选项
Backup *Backup `yaml:"backup,omitempty" json:"backup,omitempty" xml:"backup,omitempty"`
}
Config 配置项
func (*Config) SanitizeConfig ¶
func (c *Config) SanitizeConfig() *web.FieldError
type Linkage ¶
type Linkage[T any] struct { // contains filtered or unexported fields }
Linkage 级联菜单元素
func LoadLinkage ¶
LoadLinkage 加载一组级联数据
func (*Linkage[T]) Add ¶
func (l *Linkage[T]) Add(v T, parent int64) (*LinkageItem[T], error)
Add 将 v 添加至 parent 之下
func (*Linkage[T]) Get ¶
func (l *Linkage[T]) Get(id int64) *LinkageItem[T]
Get 返回指定 id 的子元素
可以查找非根元素的元素,如果找不到则返回 nil。
func (*Linkage[T]) Items ¶
func (l *Linkage[T]) Items() []*LinkageItem[T]
type LinkageItem ¶
type LinkageItem[T any] struct { ID int64 Data T Items []*LinkageItem[T] }
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.