services

package
v0.0.0-...-7531cac Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: MIT Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrShareNotFound   = errors.New("share not found")
	ErrInvalidPassword = errors.New("invalid password")
	ErrShareExpired    = errors.New("share expired")
)
View Source
var (
	ErrorStreamAbandoned = errors.New("stream abandoned")
)

Functions

This section is empty.

Types

type AuthService

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

func NewAuthService

func NewAuthService(db *gorm.DB, cnf *config.Config, cache cache.Cacher) *AuthService

func (*AuthService) GetSession

func (as *AuthService) GetSession(c *gin.Context) *schemas.Session

func (*AuthService) HandleMultipleLogin

func (as *AuthService) HandleMultipleLogin(c *gin.Context)

func (*AuthService) LogIn

func (as *AuthService) LogIn(c *gin.Context, session *schemas.TgSession) (*schemas.Message, *types.AppError)

func (*AuthService) Logout

func (as *AuthService) Logout(c *gin.Context) (*schemas.Message, *types.AppError)

type FileService

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

func NewFileService

func NewFileService(
	db *gorm.DB,
	cnf *config.Config,
	worker *tgc.StreamWorker,
	botWorker *tgc.BotWorker,
	kv kv.KV,
	cache cache.Cacher,
	logger *zap.SugaredLogger) *FileService

func (*FileService) CopyFile

func (fs *FileService) CopyFile(c *gin.Context) (*schemas.FileOut, *types.AppError)

func (*FileService) CreateFile

func (fs *FileService) CreateFile(c *gin.Context, userId int64, fileIn *schemas.FileIn) (*schemas.FileOut, *types.AppError)

func (*FileService) CreateShare

func (fs *FileService) CreateShare(fileId string, userId int64, payload *schemas.FileShareIn) *types.AppError

func (*FileService) DeleteFiles

func (fs *FileService) DeleteFiles(userId int64, payload *schemas.DeleteOperation) (*schemas.Message, *types.AppError)

func (*FileService) DeleteShare

func (fs *FileService) DeleteShare(fileId string, userId int64) *types.AppError

func (*FileService) GetCategoryStats

func (fs *FileService) GetCategoryStats(userId int64) ([]schemas.FileCategoryStats, *types.AppError)

func (*FileService) GetFileByID

func (fs *FileService) GetFileByID(id string) (*schemas.FileOutFull, *types.AppError)

func (*FileService) GetFileStream

func (fs *FileService) GetFileStream(c *gin.Context, download bool, sharedFile *schemas.FileShareOut)

func (*FileService) GetShareByFileId

func (fs *FileService) GetShareByFileId(fileId string, userId int64) (*schemas.FileShareOut, *types.AppError)

func (*FileService) ListFiles

func (fs *FileService) ListFiles(userId int64, fquery *schemas.FileQuery) (*schemas.FileResponse, *types.AppError)

func (*FileService) MakeDirectory

func (fs *FileService) MakeDirectory(userId int64, payload *schemas.MkDir) (*schemas.FileOut, *types.AppError)

func (*FileService) MoveDirectory

func (fs *FileService) MoveDirectory(userId int64, payload *schemas.DirMove) (*schemas.Message, *types.AppError)

func (*FileService) MoveFiles

func (fs *FileService) MoveFiles(userId int64, payload *schemas.FileOperation) (*schemas.Message, *types.AppError)

func (*FileService) UpdateFile

func (fs *FileService) UpdateFile(id string, userId int64, update *schemas.FileUpdate) (*schemas.FileOut, *types.AppError)

func (*FileService) UpdateParts

func (fs *FileService) UpdateParts(c *gin.Context, id string, userId int64, payload *schemas.PartUpdate) (*schemas.Message, *types.AppError)

func (*FileService) UpdateShare

func (fs *FileService) UpdateShare(fileId string, userId int64, payload *schemas.FileShareIn) *types.AppError

type ShareService

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

func NewShareService

func NewShareService(db *gorm.DB, fs *FileService, cache cache.Cacher) *ShareService

func (*ShareService) GetShareById

func (ss *ShareService) GetShareById(shareId string) (*schemas.FileShareOut, *types.AppError)

func (*ShareService) ListShareFiles

func (ss *ShareService) ListShareFiles(shareId string, query *schemas.ShareFileQuery, auth string) (*schemas.FileResponse, *types.AppError)

func (*ShareService) ShareUnlock

func (ss *ShareService) ShareUnlock(shareId string, payload *schemas.ShareAccess) *types.AppError

func (*ShareService) StreamSharedFile

func (ss *ShareService) StreamSharedFile(c *gin.Context, download bool)

type UploadService

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

func NewUploadService

func NewUploadService(db *gorm.DB, cnf *config.Config, worker *tgc.BotWorker, kv kv.KV, cache cache.Cacher) *UploadService

func (*UploadService) DeleteUploadFile

func (us *UploadService) DeleteUploadFile(c *gin.Context) (*schemas.Message, *types.AppError)

func (*UploadService) GetUploadFileById

func (us *UploadService) GetUploadFileById(c *gin.Context) (*schemas.UploadOut, *types.AppError)

func (*UploadService) GetUploadStats

func (us *UploadService) GetUploadStats(userId int64, days int) ([]schemas.UploadStats, *types.AppError)

func (*UploadService) UploadFile

func (us *UploadService) UploadFile(c *gin.Context) (*schemas.UploadPartOut, *types.AppError)

type UserService

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

func NewUserService

func NewUserService(db *gorm.DB, cnf *config.Config, kv kv.KV, cache cache.Cacher) *UserService

func (*UserService) AddBots

func (us *UserService) AddBots(c *gin.Context) (*schemas.Message, *types.AppError)

func (*UserService) GetProfilePhoto

func (us *UserService) GetProfilePhoto(c *gin.Context)

func (*UserService) GetStats

func (us *UserService) GetStats(c *gin.Context) (*schemas.AccountStats, *types.AppError)

func (*UserService) ListChannels

func (us *UserService) ListChannels(c *gin.Context) ([]schemas.Channel, *types.AppError)

func (*UserService) ListSessions

func (us *UserService) ListSessions(c *gin.Context) ([]schemas.SessionOut, *types.AppError)

func (*UserService) RemoveBots

func (us *UserService) RemoveBots(c *gin.Context) (*schemas.Message, *types.AppError)

func (*UserService) RemoveSession

func (us *UserService) RemoveSession(c *gin.Context) (*schemas.Message, *types.AppError)

func (*UserService) UpdateChannel

func (us *UserService) UpdateChannel(c *gin.Context) (*schemas.Message, *types.AppError)

Jump to

Keyboard shortcuts

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