fileupdater

package
v2.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package fileupdater 编辑内容时更新相关引用文件的关联关系 用法:fileupdater.New(fileModel.NewEmbedded(ctx)).Set(`表名称`,`字段名称`,主键ID).Add(`/test/image.jpg`,false)

Index

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) Add

func (f *FileUpdater) Add(content *string, embedded bool) (err error)

func (*FileUpdater) Delete

func (f *FileUpdater) Delete() (err error)

func (*FileUpdater) Edit

func (f *FileUpdater) Edit(content *string, embedded bool) (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)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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