proxy

package
v0.0.0-...-cbbc4cb Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CallHomeStruct

func CallHomeStruct[T any](req Request) (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) AddTree

func (pfs *ProxyFileService) AddTree(tree fileTree.FileTree)

func (*ProxyFileService) CreateFile

func (pfs *ProxyFileService) CreateFile(parent *fileTree.WeblensFileImpl, filename string, event *fileTree.FileEvent, caster models.FileCaster) (
	*fileTree.WeblensFileImpl, error,
)

func (*ProxyFileService) CreateFolder

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

func (*ProxyFileService) CreateRestoreFile

func (pfs *ProxyFileService) CreateRestoreFile(lifetime *fileTree.Lifetime) (
	restoreFile *fileTree.WeblensFileImpl, err error,
)

func (*ProxyFileService) CreateTmpFile

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

func (*ProxyFileService) CreateUserHome

func (pfs *ProxyFileService) CreateUserHome(user *models.User) error

func (*ProxyFileService) DeleteCacheFile

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

func (*ProxyFileService) DeleteFiles

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

func (*ProxyFileService) GetFileByContentId

func (pfs *ProxyFileService) GetFileByContentId(contentId models.ContentId) (*fileTree.WeblensFileImpl, error)

func (*ProxyFileService) GetFileByTree

func (pfs *ProxyFileService) GetFileByTree(id fileTree.FileId, treeAlias string) (*fileTree.WeblensFileImpl, error)

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

func (pfs *ProxyFileService) GetFileTreeByName(treeName string) fileTree.FileTree

func (*ProxyFileService) GetFiles

func (*ProxyFileService) GetFolderCover

func (pfs *ProxyFileService) GetFolderCover(folder *fileTree.WeblensFileImpl) (models.ContentId, error)

func (*ProxyFileService) GetJournalByTree

func (pfs *ProxyFileService) GetJournalByTree(treeName string) fileTree.Journal

func (*ProxyFileService) GetMediaCacheByFilename

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

func (*ProxyFileService) GetTasks

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

func (*ProxyFileService) GetUsersRoot

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

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, treeName string, 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) NewBackupFile

func (pfs *ProxyFileService) NewBackupFile(lt *fileTree.Lifetime) (*fileTree.WeblensFileImpl, 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) 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) RestoreFiles

func (pfs *ProxyFileService) RestoreFiles(
	ids []fileTree.FileId, newParent *fileTree.WeblensFileImpl, restoreTime time.Time, caster models.FileCaster,
) error

func (*ProxyFileService) RestoreHistory

func (pfs *ProxyFileService) RestoreHistory(lifetimes []*fileTree.Lifetime) error

func (*ProxyFileService) ReturnFilesFromTrash

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

func (*ProxyFileService) SetFolderCover

func (pfs *ProxyFileService) SetFolderCover(folderId fileTree.FileId, coverId models.ContentId) error

func (*ProxyFileService) Size

func (pfs *ProxyFileService) Size(treeName string) int64

func (*ProxyFileService) UserPathToFile

func (pfs *ProxyFileService) UserPathToFile(searchPath string, user *models.User) (*fileTree.WeblensFileImpl, error)

type ProxyJournalService

type ProxyJournalService struct {
	Core *models.Instance
}

func (*ProxyJournalService) Add

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

func (*ProxyJournalService) Clear

func (pjs *ProxyJournalService) Clear() 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) GetPastFile

func (pjs *ProxyJournalService) GetPastFile(id fileTree.FileId, time time.Time) (*fileTree.WeblensFileImpl, error)

func (*ProxyJournalService) GetPastFolderChildren

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

func (*ProxyJournalService) IgnoreLocal

func (pjs *ProxyJournalService) IgnoreLocal() bool

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

func (pjs *ProxyJournalService) SetIgnoreLocal(ignore bool)

func (*ProxyJournalService) UpdateLifetime

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

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

func (pms *ProxyMediaService) AddFileToMedia(m *models.Media, f *fileTree.WeblensFileImpl) error

func (*ProxyMediaService) AdjustMediaDates

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

func (*ProxyMediaService) Cleanup

func (pms *ProxyMediaService) Cleanup() 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.Media

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
	// contains filtered or unexported fields
}

func NewProxyUserService

func NewProxyUserService(core *models.Instance) *ProxyUserService

func (*ProxyUserService) ActivateUser

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

func (*ProxyUserService) Add

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

func (*ProxyUserService) CreateOwner

func (pus *ProxyUserService) CreateOwner(username, password string) (*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) 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) UpdateUserHome

func (pus *ProxyUserService) UpdateUserHome(u *models.User) error

func (*ProxyUserService) UpdateUserPassword

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

type Request

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

func NewCoreRequest

func NewCoreRequest(remote *models.Instance, method, endpoint string) Request

func (Request) Call

func (r Request) Call() (*http.Response, error)

func (Request) OverwriteEndpoint

func (r Request) OverwriteEndpoint(newEndpoint string) Request

func (Request) WithBody

func (r Request) WithBody(body any) Request

func (Request) WithBodyBytes

func (r Request) WithBodyBytes(bodyBytes []byte) Request

func (Request) WithQuery

func (r Request) WithQuery(key, val string) Request

Jump to

Keyboard shortcuts

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