services

package
v0.0.0-...-6b36e67 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 57 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetChannelById

func GetChannelById(ctx context.Context, client *telegram.Client, channelId int64, userID string) (*tg.InputChannel, error)

func GetDefaultChannel

func GetDefaultChannel(ctx context.Context, db *gorm.DB, userID int64) (int64, error)

func GetUserAuth

func GetUserAuth(c *gin.Context) (int64, string)

Types

type AuthService

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

func NewAuthService

func NewAuthService(db *gorm.DB, cnf *config.Config) *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) *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) DeleteFiles

func (fs *FileService) DeleteFiles(userId int64, payload *schemas.FileOperation) (*schemas.Message, *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)

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)

type UploadService

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

func NewUploadService

func NewUploadService(db *gorm.DB, cnf *config.Config, worker *tgc.UploadWorker, kv kv.KV) *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) *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) (interface{}, *types.AppError)

func (*UserService) RemoveBots

func (us *UserService) RemoveBots(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