Documentation ¶
Overview ¶
Package fileupdater 编辑内容时更新相关引用文件的关联关系 用法:fileupdater.New(fileModel.NewEmbedded(ctx)).Set(`表名称`,`字段名称`,主键ID).Add(`/test/image.jpg`,false)
Index ¶
- type FileUpdater
- func (f *FileUpdater) Add(content *string, embedded bool) (err error)
- func (f *FileUpdater) Delete() (err error)
- func (f *FileUpdater) Edit(content *string, embedded bool) (err error)
- func (f *FileUpdater) Handle(event string, content *string, embedded bool) error
- func (f *FileUpdater) Set(table string, field string, tableID string) *FileUpdater
- func (f *FileUpdater) SetField(field string) *FileUpdater
- func (f *FileUpdater) SetProject(project string) *FileUpdater
- func (f *FileUpdater) SetSeperator(seperator string) *FileUpdater
- func (f *FileUpdater) SetTable(table string) *FileUpdater
- func (f *FileUpdater) SetTableID(tableID string) *FileUpdater
- type Reler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileUpdater ¶
type FileUpdater struct {
// contains filtered or unexported fields
}
func New ¶
func New(reler Reler) *FileUpdater
func (*FileUpdater) Delete ¶
func (f *FileUpdater) Delete() (err error)
func (*FileUpdater) Handle ¶
func (f *FileUpdater) Handle(event string, content *string, embedded bool) error
func (*FileUpdater) Set ¶
func (f *FileUpdater) Set(table string, field string, tableID string) *FileUpdater
func (*FileUpdater) SetField ¶
func (f *FileUpdater) SetField(field string) *FileUpdater
func (*FileUpdater) SetProject ¶
func (f *FileUpdater) SetProject(project string) *FileUpdater
func (*FileUpdater) SetSeperator ¶
func (f *FileUpdater) SetSeperator(seperator string) *FileUpdater
func (*FileUpdater) SetTable ¶
func (f *FileUpdater) SetTable(table string) *FileUpdater
func (*FileUpdater) SetTableID ¶
func (f *FileUpdater) SetTableID(tableID string) *FileUpdater
type Reler ¶
type Reler interface { RelationFiles(project string, table string, field string, tableID string, content string, seperator ...string) error RelationEmbeddedFiles(project string, table string, field string, tableID string, content string) error DeleteByTableID(project string, table string, tableID string) error FileIDs() []uint64 MoveFileToOwner(table string, fileIDs []uint64, ownerID string) (replaces map[string]string, err error) }
Click to show internal directories.
Click to hide internal directories.