proxy

package
v0.0.0-...-18b418f Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallHomeStruct

func CallHomeStruct[T any](remote *models.Instance, method, endpoint string, body any) (T, error)

Types

type ProxyFileService

type ProxyFileService struct {
	Core *models.Instance
}

func (*ProxyFileService) AddTask

func (pfs *ProxyFileService) AddTask(f *fileTree.WeblensFileImpl, t *task.Task) error

func (*ProxyFileService) CreateFile

func (pfs *ProxyFileService) CreateFile(parent *fileTree.WeblensFileImpl, filename string) (
	*fileTree.WeblensFileImpl, error,
)

func (*ProxyFileService) CreateFolder

func (pfs *ProxyFileService) CreateFolder(
	parent *fileTree.WeblensFileImpl, foldername string, caster models.FileCaster,
) (*fileTree.WeblensFileImpl, error)

func (*ProxyFileService) DeleteCacheFile

func (pfs *ProxyFileService) DeleteCacheFile(file fileTree.WeblensFile) error

func (*ProxyFileService) GetFile

func (*ProxyFileService) GetFileOwner

func (pfs *ProxyFileService) GetFileOwner(file *fileTree.WeblensFileImpl) *models.User

func (*ProxyFileService) GetFileSafe

func (pfs *ProxyFileService) GetFileSafe(
	id fileTree.FileId, accessor *models.User, share *models.FileShare,
) (*fileTree.WeblensFileImpl, error)

func (*ProxyFileService) GetFiles

func (pfs *ProxyFileService) GetFiles(ids []fileTree.FileId) ([]*fileTree.WeblensFileImpl, error)

func (*ProxyFileService) GetMediaCacheByFilename

func (pfs *ProxyFileService) GetMediaCacheByFilename(filename string) (*fileTree.WeblensFileImpl, error)

func (*ProxyFileService) GetMediaJournal

func (pfs *ProxyFileService) GetMediaJournal() fileTree.Journal

func (*ProxyFileService) GetMediaRoot

func (pfs *ProxyFileService) GetMediaRoot() *fileTree.WeblensFileImpl

func (*ProxyFileService) GetTasks

func (pfs *ProxyFileService) GetTasks(f *fileTree.WeblensFileImpl) []*task.Task

func (*ProxyFileService) GetZip

func (*ProxyFileService) ImportFile

func (pfs *ProxyFileService) ImportFile(f *fileTree.WeblensFileImpl) error

func (*ProxyFileService) IsFileInTrash

func (pfs *ProxyFileService) IsFileInTrash(file *fileTree.WeblensFileImpl) bool

func (*ProxyFileService) MoveFiles

func (pfs *ProxyFileService) MoveFiles(
	files []*fileTree.WeblensFileImpl, destFolder *fileTree.WeblensFileImpl, caster models.FileCaster,
) error

func (*ProxyFileService) MoveFilesToTrash

func (pfs *ProxyFileService) MoveFilesToTrash(
	file []*fileTree.WeblensFileImpl, mover *models.User, share *models.FileShare, caster models.FileCaster,
) error

func (*ProxyFileService) NewCacheFile

func (pfs *ProxyFileService) NewCacheFile(
	media *models.Media, quality models.MediaQuality, pageNum int,
) (*fileTree.WeblensFileImpl, error)

func (*ProxyFileService) NewZip

func (pfs *ProxyFileService) NewZip(zipName string, owner *models.User) (*fileTree.WeblensFileImpl, error)

func (*ProxyFileService) PathToFile

func (pfs *ProxyFileService) PathToFile(
	searchPath string,
) (*fileTree.WeblensFileImpl, error)

func (*ProxyFileService) PermanentlyDeleteFiles

func (pfs *ProxyFileService) PermanentlyDeleteFiles(files []*fileTree.WeblensFileImpl, caster models.FileCaster) error

func (*ProxyFileService) ReadFile

func (*ProxyFileService) RemoveTask

func (pfs *ProxyFileService) RemoveTask(f *fileTree.WeblensFileImpl, t *task.Task) error

func (*ProxyFileService) RenameFile

func (pfs *ProxyFileService) RenameFile(
	file *fileTree.WeblensFileImpl, newName string, caster models.FileCaster,
) error

func (*ProxyFileService) ResizeDown

func (pfs *ProxyFileService) ResizeDown(file *fileTree.WeblensFileImpl, caster models.FileCaster) error

func (*ProxyFileService) ResizeUp

func (pfs *ProxyFileService) ResizeUp(file *fileTree.WeblensFileImpl, caster models.FileCaster) error

func (*ProxyFileService) ReturnFilesFromTrash

func (pfs *ProxyFileService) ReturnFilesFromTrash(files []*fileTree.WeblensFileImpl, caster models.FileCaster) error

type ProxyJournalService

type ProxyJournalService struct {
	Core *models.Instance
}

func (*ProxyJournalService) Add

func (pjs *ProxyJournalService) Add(lifetime *fileTree.Lifetime) error

func (*ProxyJournalService) Del

func (*ProxyJournalService) EventWorker

func (pjs *ProxyJournalService) EventWorker()

func (*ProxyJournalService) FileWatcher

func (pjs *ProxyJournalService) FileWatcher()

func (*ProxyJournalService) Get

func (*ProxyJournalService) GetActionsByPath

func (pjs *ProxyJournalService) GetActionsByPath(filepath fileTree.WeblensFilepath) ([]*fileTree.FileAction, error)

func (*ProxyJournalService) GetActiveLifetimes

func (pjs *ProxyJournalService) GetActiveLifetimes() []*fileTree.Lifetime

func (*ProxyJournalService) GetAllLifetimes

func (pjs *ProxyJournalService) GetAllLifetimes() []*fileTree.Lifetime

func (*ProxyJournalService) GetLatestAction

func (pjs *ProxyJournalService) GetLatestAction() (*fileTree.FileAction, error)

func (*ProxyJournalService) GetLifetimesSince

func (pjs *ProxyJournalService) GetLifetimesSince(date time.Time) ([]*fileTree.Lifetime, error)

func (*ProxyJournalService) GetPastFolderChildren

func (pjs *ProxyJournalService) GetPastFolderChildren(folder *fileTree.WeblensFileImpl, time time.Time) (
	[]*fileTree.WeblensFileImpl, error,
)

func (*ProxyJournalService) LogEvent

func (pjs *ProxyJournalService) LogEvent(fe *fileTree.FileEvent)

func (*ProxyJournalService) NewEvent

func (pjs *ProxyJournalService) NewEvent() *fileTree.FileEvent

func (*ProxyJournalService) SetFileTree

func (pjs *ProxyJournalService) SetFileTree(ft *fileTree.FileTreeImpl)

func (*ProxyJournalService) WatchFolder

func (pjs *ProxyJournalService) WatchFolder(f *fileTree.WeblensFileImpl) error

type ProxyMediaService

type ProxyMediaService struct {
	Core *models.Instance
}

func (*ProxyMediaService) Add

func (pms *ProxyMediaService) Add(media *models.Media) error

func (*ProxyMediaService) AdjustMediaDates

func (pms *ProxyMediaService) AdjustMediaDates(
	anchor *models.Media, newTime time.Time, extraMedias []*models.Media,
) error

func (*ProxyMediaService) Del

func (pms *ProxyMediaService) Del(id models.ContentId) error

func (*ProxyMediaService) FetchCacheImg

func (pms *ProxyMediaService) FetchCacheImg(m *models.Media, quality models.MediaQuality, pageNum int) ([]byte, error)

func (*ProxyMediaService) Get

func (*ProxyMediaService) GetAll

func (pms *ProxyMediaService) GetAll() []*models.Media

func (*ProxyMediaService) GetFilteredMedia

func (pms *ProxyMediaService) GetFilteredMedia(
	requester *models.User, sort string, sortDirection int, excludeIds []models.ContentId, raw bool, hidden bool,
) ([]*models.Media, error)

func (*ProxyMediaService) GetMediaType

func (pms *ProxyMediaService) GetMediaType(m *models.Media) models.MediaType

func (*ProxyMediaService) GetMediaTypes

func (pms *ProxyMediaService) GetMediaTypes() models.MediaTypeService

func (*ProxyMediaService) GetProminentColors

func (pms *ProxyMediaService) GetProminentColors(media *models.Media) (prom []string, err error)

func (*ProxyMediaService) HideMedia

func (pms *ProxyMediaService) HideMedia(m *models.Media, hidden bool) error

func (*ProxyMediaService) IsCached

func (pms *ProxyMediaService) IsCached(m *models.Media) bool

func (*ProxyMediaService) IsFileDisplayable

func (pms *ProxyMediaService) IsFileDisplayable(file *fileTree.WeblensFileImpl) bool

func (*ProxyMediaService) LoadMediaFromFile

func (pms *ProxyMediaService) LoadMediaFromFile(m *models.Media, file *fileTree.WeblensFileImpl) error

func (*ProxyMediaService) NukeCache

func (pms *ProxyMediaService) NukeCache() error

func (*ProxyMediaService) RecursiveGetMedia

func (pms *ProxyMediaService) RecursiveGetMedia(folders ...*fileTree.WeblensFileImpl) []models.ContentId

func (*ProxyMediaService) RemoveFileFromMedia

func (pms *ProxyMediaService) RemoveFileFromMedia(media *models.Media, fileId fileTree.FileId) error

func (*ProxyMediaService) SetMediaLiked

func (pms *ProxyMediaService) SetMediaLiked(mediaId models.ContentId, liked bool, username models.Username) error

func (*ProxyMediaService) Size

func (pms *ProxyMediaService) Size() int

func (*ProxyMediaService) StreamCacheVideo

func (pms *ProxyMediaService) StreamCacheVideo(m *models.Media, startByte, endByte int) ([]byte, error)

func (*ProxyMediaService) StreamVideo

func (pms *ProxyMediaService) StreamVideo(m *models.Media, u *models.User, share *models.FileShare) (
	*models.VideoStreamer, error,
)

type ProxyUserService

type ProxyUserService struct {
	Core *models.Instance
}

func (*ProxyUserService) ActivateUser

func (pus *ProxyUserService) ActivateUser(user *models.User) error

func (*ProxyUserService) Add

func (pus *ProxyUserService) Add(user *models.User) error

func (*ProxyUserService) Del

func (pus *ProxyUserService) Del(id models.Username) error

func (*ProxyUserService) GenerateToken

func (pus *ProxyUserService) GenerateToken(user *models.User) (string, error)

func (*ProxyUserService) Get

func (pus *ProxyUserService) Get(id models.Username) *models.User

func (*ProxyUserService) GetAll

func (pus *ProxyUserService) GetAll() (iter.Seq[*models.User], error)

func (*ProxyUserService) GetPublicUser

func (pus *ProxyUserService) GetPublicUser() *models.User

func (*ProxyUserService) GetRootUser

func (pus *ProxyUserService) GetRootUser() *models.User

func (*ProxyUserService) Init

func (pus *ProxyUserService) Init() error

func (*ProxyUserService) SearchByUsername

func (pus *ProxyUserService) SearchByUsername(searchString string) (iter.Seq[*models.User], error)

func (*ProxyUserService) SetUserAdmin

func (pus *ProxyUserService) SetUserAdmin(user *models.User, b bool) error

func (*ProxyUserService) Size

func (pus *ProxyUserService) Size() int

func (*ProxyUserService) UpdateUserPassword

func (pus *ProxyUserService) UpdateUserPassword(
	username models.Username, oldPassword, newPassword string, allowEmptyOld bool,
) error

Jump to

Keyboard shortcuts

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