listener

package
v2.2.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2020 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBI = func() *factory.DBI {
	return dbschema.DBI
}
View Source
var UpdaterInfos = map[string]map[string]map[string]UpdaterInfo{
	``: {
		`nging_file`: {
			`view_url`: UpdaterInfo{},
		},
		`nging_file_thumb`: {
			`view_url`: UpdaterInfo{},
		},
	},
}

UpdaterInfos [Project][Table][Field]

Functions

func RecordUpdaterInfo

func RecordUpdaterInfo(project, table, field, seperator string, embedded bool, sameFields ...string)

RecordUpdaterInfo 记录

Types

type Callback

type Callback func(m factory.Model) (tableID string, content string, property *Property)

type FileRelation

type FileRelation struct {
	TableName  string   // 数据表名称
	FieldName  string   // 数据表字段名
	SameFields []string // 数据表类似字段名
	Embedded   bool     // 是否为嵌入图片
	Seperator  string   // 文件字段中多个文件路径之间的分隔符,空字符串代表为单个文件
	// contains filtered or unexported fields
}

FileRelation 文件关联数据监听 FileRelation.SetTable(`table`,`field`).ListenDefault()

func New

func New(cb Callback, embedded bool, seperators ...string) *FileRelation

New 实例化监听器具

func (*FileRelation) Callback

func (f *FileRelation) Callback() Callback

func (*FileRelation) DBI

func (f *FileRelation) DBI() *factory.DBI

func (*FileRelation) Listen

func (f *FileRelation) Listen(events ...string) *FileRelation

func (*FileRelation) ListenDefault

func (f *FileRelation) ListenDefault() *FileRelation

func (*FileRelation) On

func (*FileRelation) OnRead

func (*FileRelation) SetDBI

func (f *FileRelation) SetDBI(dbi *factory.DBI) *FileRelation

func (*FileRelation) SetEmbedded

func (f *FileRelation) SetEmbedded(embedded bool) *FileRelation

func (*FileRelation) SetSeperator

func (f *FileRelation) SetSeperator(seperator string) *FileRelation

func (*FileRelation) SetTable

func (f *FileRelation) SetTable(table string, field string, samesFields ...string) *FileRelation

type Property

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

func NewProUP

func NewProUP(m factory.Model, cond db.Compound) *Property

func NewProperty

func NewProperty() *Property

func (*Property) Embedded

func (pro *Property) Embedded() bool

func (*Property) Exit

func (pro *Property) Exit() bool

func (*Property) GenUpdater

func (pro *Property) GenUpdater(m factory.Model, cond db.Compound) *Property

func (*Property) Seperator

func (pro *Property) Seperator() string

func (*Property) SetEmbedded

func (pro *Property) SetEmbedded(on bool) *Property

func (*Property) SetExit

func (pro *Property) SetExit(exit bool) *Property

func (*Property) SetSeperator

func (pro *Property) SetSeperator(sep string) *Property

func (*Property) SetUpdater

func (pro *Property) SetUpdater(updater func(field string, content string) error) *Property

func (*Property) Updater

func (pro *Property) Updater() func(field string, content string) error

type UpdaterInfo

type UpdaterInfo struct {
	Seperator string
	Embedded  bool
}

Jump to

Keyboard shortcuts

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