Documentation
¶
Index ¶
- func ValidateToken(accessToken string, tokenType string) (username string, valid bool)
- type Service
- func (s *Service) CreateArticle(title string, body string, username string) (articlename string, err error)
- func (s *Service) CreateUser(username string, name string, password string) (err error)
- func (s *Service) DeleteArticle(articlename string) (err error)
- func (s *Service) DeleteUser(username string) (err error)
- func (s *Service) FindUsers(pattern string, quantity int) (users []model.FindUsers, err error)
- func (s *Service) GetArticle(articlename string) (title string, body string, creationDate time.Time, username string, err error)
- func (s *Service) GetArticles(title string, username string, from string, to string, quantity int) (articles []model.Article, err error)
- func (s *Service) GetDelRefreshToken(refreshToken string) (username string, err error)
- func (s *Service) GetUser(username string) (name string, err error)
- func (s *Service) LoadArticleCache(path string) (title string, body string, creationDate string, username string, err error)
- func (s *Service) LoadUserCache(path string) (name string, err error)
- func (s *Service) Login(username string, password string) (accessToken string, refreshToken string, err error)
- func (s *Service) RefreshTokens(username string) (accessToken string, refreshToken string, err error)
- func (s *Service) SetRefreshToken(refreshToken string, username string) (err error)
- func (s *Service) UpdateArticle(articlename string, newTitle string, newBody string) (err error)
- func (s *Service) UpdateUser(username string, newName string, newPassword string) (err error)
- func (s *Service) UploadArticleCache(path string, title string, body string, creationDate string, username string) (err error)
- func (s *Service) UploadUserCache(path string, name string) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(db *repository.Repository, tokenStorage *storage.Storage, cacheStorage *storage.Storage) (service *Service)
func (*Service) CreateArticle ¶
func (*Service) CreateUser ¶
func (*Service) DeleteArticle ¶
func (*Service) DeleteUser ¶
func (*Service) GetArticle ¶
func (*Service) GetArticles ¶
func (*Service) GetDelRefreshToken ¶
func (*Service) LoadArticleCache ¶
func (*Service) LoadUserCache ¶
func (*Service) RefreshTokens ¶
func (*Service) SetRefreshToken ¶
func (*Service) UpdateArticle ¶
func (*Service) UpdateUser ¶
func (*Service) UploadArticleCache ¶
Click to show internal directories.
Click to hide internal directories.