Documentation
¶
Index ¶
- Variables
- type AlbumAgent
- type AlbumCoverRepo
- type AlbumRepo
- type ArtistAgent
- type ArtistRepo
- type AuthUseCase
- type GlobalStorageInterface
- type LinkerAgent
- type LinkerRepo
- type PlaylistAgent
- type PlaylistRepo
- type Session
- type SessionRepo
- type TrackAgent
- type TrackRepo
- type User
- type UserRepo
- type UserUseCase
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLoginOrPassword = errors.New("invalid login or password") ErrUserAlreadyExist = errors.New("user already exist") ErrUserDoesNotExist = errors.New("user does not exist") ErrInsert = errors.New("insertion error") ErrDatabaseUnexpected = errors.New("database unexpected error") ErrWhileSetNewSession = errors.New("error while set new session") ErrWhileChangeSession = errors.New("error while change session") ErrSessionStorageUnexpected = errors.New("session storage unexpected error") ErrSessionDoesNotExist = errors.New("session does not exist") ErrGetSession = errors.New("error while get session") ErrSetSession = errors.New("error while set session") ErrDeleteSession = errors.New("error while delete session") )
Functions ¶
This section is empty.
Types ¶
type AlbumAgent ¶
type AlbumAgent interface { GetAll() ([]*albumProto.Album, error) GetAllCovers() ([]*albumProto.AlbumCover, error) GetLastId() (int64, error) GetLastCoverId() (int64, error) Create(*albumProto.Album) error CreateCover(*albumProto.AlbumCover) error Update(*albumProto.Album) error UpdateCover(*albumProto.AlbumCover) error Delete(int64) error DeleteCover(int64) error GetById(int64) (*albumProto.Album, error) GetCoverById(int64) (*albumProto.AlbumCover, error) GetPopular() ([]*albumProto.Album, error) GetAlbumsFromArtist(int64) ([]*albumProto.Album, error) GetSize() (int64, error) SearchByTitle(title string) ([]*albumProto.Album, error) GetFavorites(userId int64) ([]*albumProto.Album, error) AddToFavorites(userId int64, albumId int64) error RemoveFromFavorites(userId int64, albumId int64) error Like(userId int64, albumId int64) error LikeCheckByUser(userId int64, albumId int64) (bool, error) GetPopularAlbumOfWeekTop20() ([]*albumProto.Album, error) }
type AlbumCoverRepo ¶
type AlbumCoverRepo interface { Create(*albumProto.AlbumCover) error Update(*albumProto.AlbumCover) error Delete(int64) error SelectByID(int64) (*albumProto.AlbumCover, error) GetAll() ([]*albumProto.AlbumCover, error) GetLastId() (id int64, err error) GetSize() (int64, error) }
type AlbumRepo ¶
type AlbumRepo interface { Create(*albumProto.Album) error Update(*albumProto.Album) error Delete(int64) error SelectByID(int64) (*albumProto.Album, error) GetAll() ([]*albumProto.Album, error) GetPopular() ([]*albumProto.Album, error) GetLastId() (id int64, err error) GetSize() (int64, error) GetAlbumsFromArtist(artist int64) ([]*albumProto.Album, error) SearchByTitle(title string) ([]*albumProto.Album, error) Like(id int64, userId int64) error LikeCheckByUser(id int64, userId int64) (bool, error) Listen(id int64) error GetFavorites(userId int64) ([]*albumProto.Album, error) AddToFavorites(id int64, userId int64) error RemoveFromFavorites(albumId int64, userId int64) error GetPopularAlbumOfWeekTop20() ([]*albumProto.Album, error) CountPopularAlbumOfWeek() (bool, error) }
type ArtistAgent ¶
type ArtistAgent interface { GetAll() ([]*artistProto.Artist, error) GetLastId() (int64, error) Create(*artistProto.Artist) error Update(*artistProto.Artist) error Delete(int64) error GetById(int64) (*artistProto.Artist, error) GetPopular() ([]*artistProto.Artist, error) GetSize() (int64, error) SearchByName(name string) ([]*artistProto.Artist, error) GetFavorites(int64) ([]*artistProto.Artist, error) AddToFavorites(userId int64, artistId int64) error RemoveFromFavorites(userId int64, artistId int64) error Like(userId int64, artistId int64) error LikeCheckByUser(userId int64, artistId int64) (bool, error) }
type ArtistRepo ¶
type ArtistRepo interface { Create(*artistProto.Artist) error Update(*artistProto.Artist) error Delete(int64) error SelectByID(int64) (*artistProto.Artist, error) GetAll() ([]*artistProto.Artist, error) GetPopular() ([]*artistProto.Artist, error) GetLastId() (id int64, err error) GetSize() (int64, error) SearchByName(string) ([]*artistProto.Artist, error) Like(id int64, userId int64) error LikeCheckByUser(id int64, userId int64) (bool, error) Listen(id int64) error GetFavorites(userId int64) ([]*artistProto.Artist, error) AddToFavorites(id int64, userId int64) error RemoveFromFavorites(artistId int64, userId int64) error }
type AuthUseCase ¶
type GlobalStorageInterface ¶
type GlobalStorageInterface interface { GetAlbumRepo() AlbumRepo GetAlbumCoverRepo() AlbumCoverRepo GetArtistRepo() ArtistRepo GetTrackRepo() TrackRepo GetSessionRepo() auth_domain.AuthRepo GetUserRepo() user_microservice_domain.UserRepo GetPlaylistRepo() PlaylistRepo }
type LinkerAgent ¶
type LinkerRepo ¶
type PlaylistAgent ¶
type PlaylistAgent interface { GetAll() ([]*playlistProto.Playlist, error) GetAllOfCurrentUser(userId int64) ([]*playlistProto.Playlist, error) GetLastId() (int64, error) GetLastIdOfCurrentUser(userId int64) (int64, error) Create(userId int64, playlist *playlistProto.Playlist) error Update(userId int64, playlist *playlistProto.Playlist) error Delete(userId int64, playlistId int64) error GetById(playlistId int64) (*playlistProto.Playlist, error) GetByIdOfCurrentUser(userId int64, playlistId int64) (*playlistProto.Playlist, error) GetSizeOfCurrentUser(userId int64) (int64, error) GetSize() (int64, error) AddToPlaylist(userId int64, playlistId int64, trackId int64) error RemoveFromPlaylist(userId int64, playlistId int64, trackId int64) error }
type PlaylistRepo ¶
type PlaylistRepo interface { Create(userId int64, playlist *playlistProto.Playlist) error Update(userId int64, playlist *playlistProto.Playlist) error Delete(userId int64, playlistId int64) error SelectByIDOfCurrentUser(userId int64, playlistId int64) (*playlistProto.Playlist, error) SelectById(playlistId int64) (*playlistProto.Playlist, error) GetAllOfCurrentUser(userId int64) ([]*playlistProto.Playlist, error) GetAll() ([]*playlistProto.Playlist, error) GetLastIdOfCurrentUser(userId int64) (id int64, err error) GetLastId() (id int64, err error) GetSizeOfCurrentUser(userId int64) (int64, error) GetSize() (int64, error) AddToPlaylist(userId int64, playlistId int64, trackId int64) error RemoveFromPlaylist(userId int64, playlistId int64, trackId int64) error }
type SessionRepo ¶
type TrackAgent ¶
type TrackAgent interface { GetAll() ([]*trackProto.Track, error) GetLastId() (int64, error) Create(*trackProto.Track) error Update(*trackProto.Track) error Delete(int64) error GetById(int64) (*trackProto.Track, error) GetPopular() ([]*trackProto.Track, error) GetTracksFromAlbum(int64) ([]*trackProto.Track, error) GetPopularTracksFromArtist(int64) ([]*trackProto.Track, error) GetSize() (int64, error) Like(userId int64, trackId int64) error LikeCheckByUser(userId int64, trackId int64) (bool, error) Listen(int64) error SearchByTitle(title string) ([]*trackProto.Track, error) GetFavorites(int64) ([]*trackProto.Track, error) AddToFavorites(userId int64, trackId int64) error RemoveFromFavorites(userId int64, artistId int64) error GetTracksFromPlaylist(playlistId int64) ([]*trackProto.Track, error) GetPopularTrackOfWeekTop20() ([]*trackProto.Track, error) }
type TrackRepo ¶
type TrackRepo interface { Create(*trackProto.Track) error Update(*trackProto.Track) error Delete(int64) error SelectByID(int64) (*trackProto.Track, error) GetAll() ([]*trackProto.Track, error) GetPopular() ([]*trackProto.Track, error) GetLastId() (id int64, err error) GetSize() (int64, error) GetTracksFromAlbum(albumId int64) ([]*trackProto.Track, error) GetTracksFromPlaylist(playlistId int64) ([]*trackProto.Track, error) GetPopularTracksFromArtist(artistId int64) ([]*trackProto.Track, error) Like(id int64, userId int64) error LikeCheckByUser(id int64, userId int64) (bool, error) Listen(id int64) error SearchByTitle(title string) ([]*trackProto.Track, error) GetFavorites(userId int64) ([]*trackProto.Track, error) AddToFavorites(id int64, userId int64) error RemoveFromFavorites(trackId int64, userId int64) error GetPopularTrackOfWeekTop20() ([]*trackProto.Track, error) CountPopularTrackOfWeek() (bool, error) }
type User ¶
type User struct { ID uint `json:"id,omitempty" db:"id"` Username string `json:"username,omitempty" db:"username"` Email string `json:"email,omitempty" db:"email"` Avatar string `json:"avatar,omitempty" db:"avatar"` Password string `json:"password,omitempty" db:"password_hash"` CountFollowing int `json:"count_following,omitempty" db:"count_following"` }
type UserUseCase ¶
type UserUseCase interface { GetById(userId uint) (*User, error) GetByUsername(username string) (*User, error) GetByEmail(email string) (*User, error) GetBySessionId(sessionId string) (*User, error) Update(id uint, user *User) error DeleteById(userId uint) error DeleteByUsername(username string) error DeleteByEmail(email string) error DeleteBySessionId(sessionId string) error CheckUsernameAndPassword(username string, password string) bool CheckEmailAndPassword(email string, password string) bool }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.