services

package
v0.0.0-...-ae1a546 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileUploadService

type FileUploadService struct {
	Factory    *file_upload.Factory
	Repository *repository.FileUploadRepository
}

func NewFileUploadService

func NewFileUploadService(db *gorm.DB) *FileUploadService

func (*FileUploadService) DeleteFile

func (s *FileUploadService) DeleteFile(id string) (*model.FileUpload, error)

func (*FileUploadService) GetFileById

func (s *FileUploadService) GetFileById(id string) (*model.FileUpload, error)

func (*FileUploadService) SaveFile

func (s *FileUploadService) SaveFile(file *graphql.Upload, user *model.User) (*model.FileUpload, error)

func (*FileUploadService) UpdateFile

func (s *FileUploadService) UpdateFile(input *model.UpdateFile) (*model.FileUpload, error)

type FriendService

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

func NewFriendService

func NewFriendService(db *gorm.DB) *FriendService

func (*FriendService) Befriend

func (s *FriendService) Befriend(user, friend *model.User) (*model.User, error)

func (*FriendService) Unfriend

func (s *FriendService) Unfriend(user, friend *model.User) (*model.User, error)

type JwtService

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

func NewJwtService

func NewJwtService(secret []byte) *JwtService

func (*JwtService) ClearJwtCookie

func (s *JwtService) ClearJwtCookie(w *http.ResponseWriter)

func (*JwtService) CreateAuthPayload

func (s *JwtService) CreateAuthPayload(user *model.User) jwt.Claims

func (*JwtService) CreateJwtCookie

func (s *JwtService) CreateJwtCookie(token string) *http.Cookie

func (*JwtService) Decode

func (s *JwtService) Decode(jwtToken string) (jwt.MapClaims, error)

func (*JwtService) Encode

func (s *JwtService) Encode(payload jwt.Claims) (string, error)

func (*JwtService) PutJwtCookie

func (s *JwtService) PutJwtCookie(w *http.ResponseWriter, cookie *http.Cookie)

func (*JwtService) Regenerate

func (s *JwtService) Regenerate(oldToken string) (string, error)

type PublicChatService

type PublicChatService struct {
	Repository *repository.PublicChatRepository
}

func NewPublicChatService

func NewPublicChatService(db *gorm.DB) *PublicChatService

func (*PublicChatService) All

func (s *PublicChatService) All() ([]*model.PublicMessage, error)

func (*PublicChatService) Save

type UserService

type UserService struct {
	UserRepository     *repository.UserRepository
	UserRoleRepository *repository.UserRoleRepository
}

func NewUserService

func NewUserService(db *gorm.DB) *UserService

func (*UserService) AlreadyRegistered

func (s *UserService) AlreadyRegistered(email string) bool

func (*UserService) DeleteAccount

func (s *UserService) DeleteAccount(id string) (*model.User, error)

func (*UserService) GetAllExcept

func (s *UserService) GetAllExcept(user *model.User) ([]*model.User, error)

func (*UserService) GetById

func (s *UserService) GetById(id string) (*model.User, error)

func (*UserService) Login

func (s *UserService) Login(email string, password string) (*model.User, error)

func (*UserService) Register

func (s *UserService) Register(input *model.Register) (*model.User, error)

func (*UserService) UpdateAccount

func (s *UserService) UpdateAccount(id string, input *model.UpdateUser) (*model.User, error)

Jump to

Keyboard shortcuts

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