Documentation
¶
Index ¶
- func Slugify(str string) string
- type Actions
- func (a *Actions) ApproveLyricsRequest(adminToken string, id uint) error
- func (a *Actions) AuthenticateAdmin(params AuthenticateAdminParams) (AuthenticateAdminPayload, error)
- func (a *Actions) ConfirmAuth(token string) error
- func (a *Actions) CreateLyrics(l models.Lyrics) (models.Lyrics, error)
- func (a *Actions) CreateLyricsRequest(token string, l models.Lyrics) error
- func (a *Actions) GetLyricsByPublicId(id string) (models.Lyrics, error)
- func (a *Actions) GetLyricsBySongTitle(title string) ([]models.Lyrics, error)
- func (a *Actions) GetLyricsBySongTitleAndAlbumTitle(title, albumTitle string) ([]models.Lyrics, error)
- func (a *Actions) GetLyricsBySongTitleAndArtistName(title, artistName string) ([]models.Lyrics, error)
- func (a *Actions) GetLyricsBySongTitleArtistNameAndAlbumTitle(title, artistName, albumTitle string) ([]models.Lyrics, error)
- func (a *Actions) GetLyricsRequest(adminToken string, id uint) (LyricsRequest, error)
- func (a *Actions) GetSitemap() ([]SitemapUrl, error)
- func (a *Actions) ListLyricsRequests(adminToken string) ([]LyricsRequest, error)
- func (a *Actions) LoadLyricsPublicIds() error
- func (a *Actions) RejectLyricsRequest(adminToken string, id uint, reason string) error
- func (a *Actions) SendVerificationEmail(email string) error
- type AuthenticateAdminParams
- type AuthenticateAdminPayload
- type JwtClaims
- type JwtDecoder
- type JwtManager
- type JwtSigner
- type JwtValidator
- type LyricsRequest
- type Mailer
- type Repository
- type Sitemap
- type SitemapUrl
- type Subject
- type TokenPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Actions ¶
type Actions struct {
// contains filtered or unexported fields
}
func New ¶
func New(repo Repository, mailer Mailer, jwt JwtManager[TokenPayload], sitemap Sitemap) *Actions
func (*Actions) ApproveLyricsRequest ¶ added in v0.2.0
func (*Actions) AuthenticateAdmin ¶ added in v0.2.0
func (a *Actions) AuthenticateAdmin(params AuthenticateAdminParams) (AuthenticateAdminPayload, error)
func (*Actions) ConfirmAuth ¶ added in v0.2.0
func (*Actions) CreateLyrics ¶
func (*Actions) CreateLyricsRequest ¶ added in v0.2.0
func (*Actions) GetLyricsByPublicId ¶ added in v0.3.0
func (*Actions) GetLyricsBySongTitle ¶
func (*Actions) GetLyricsBySongTitleAndAlbumTitle ¶
func (*Actions) GetLyricsBySongTitleAndArtistName ¶
func (*Actions) GetLyricsBySongTitleArtistNameAndAlbumTitle ¶
func (*Actions) GetLyricsRequest ¶ added in v0.2.0
func (a *Actions) GetLyricsRequest(adminToken string, id uint) (LyricsRequest, error)
func (*Actions) GetSitemap ¶ added in v0.3.0
func (a *Actions) GetSitemap() ([]SitemapUrl, error)
func (*Actions) ListLyricsRequests ¶ added in v0.2.0
func (a *Actions) ListLyricsRequests(adminToken string) ([]LyricsRequest, error)
func (*Actions) LoadLyricsPublicIds ¶ added in v0.3.0
func (*Actions) RejectLyricsRequest ¶ added in v0.2.0
func (*Actions) SendVerificationEmail ¶ added in v0.2.0
type AuthenticateAdminParams ¶ added in v0.2.0
type AuthenticateAdminPayload ¶ added in v0.2.0
type AuthenticateAdminPayload struct {
SessionToken string `json:"session_token"`
}
type JwtClaims ¶ added in v0.2.0
type JwtClaims[T any] struct { jwt.RegisteredClaims Payload T `json:"payload"` }
JwtClaims is iondsa, it's just JWT claims blyat!
type JwtDecoder ¶ added in v0.2.0
JwtDecoder is a wrapper to JWT decoding stuff, based on the implementation's claims, this interface is usually implemented with the other two(Signer and Validator), because reasons...
type JwtManager ¶ added in v0.2.0
type JwtManager[T any] interface { JwtSigner[T] JwtValidator JwtDecoder[T] }
JwtManager is a wrapper to JWT operations, so I don't do much shit each time I work with JWT
type JwtSigner ¶ added in v0.2.0
type JwtSigner[T any] interface { Sign(data T, subject Subject, expTime time.Duration) (string, error) }
JwtSigner is a wrapper to JWT signing method using the set JWT secret, claims are set(mostly unique) in each implementation of the thing
type JwtValidator ¶ added in v0.2.0
JwtValidator is a wrapper to JWT validation stuff, also uses the claims for that current implementation
type LyricsRequest ¶ added in v0.2.0
type Repository ¶
type Repository interface {
CreateLyrics(l models.Lyrics) (models.Lyrics, error)
GetLyricsByPublicId(id string) (models.Lyrics, error)
GetLyricsBySongTitle(Title string) ([]models.Lyrics, error)
GetLyricsBySongTitleAndArtistName(songTitle, artistName string) ([]models.Lyrics, error)
GetLyricsBySongAndAlbumTitle(songTitle, albumTitle string) ([]models.Lyrics, error)
GetLyricsBySongTitleArtistNameAndAlbumTitle(songTitle, artistName, albumTitle string) ([]models.Lyrics, error)
GetLyricses(page int) ([]models.Lyrics, error)
CreateLyricsRequest(l models.LyricsRequest) (models.LyricsRequest, error)
DeleteLyricsRequest(id uint) error
GetLyricsRequestById(id uint) (models.LyricsRequest, error)
GetLyricsRequests() ([]models.LyricsRequest, error)
GetAdminByUsername(username string) (models.Admin, error)
}
type Sitemap ¶ added in v0.3.0
type Sitemap interface {
GetLyricsEntries() ([]SitemapUrl, error)
StoreLyricsesEntries(entries []SitemapUrl) error
AddLyricsEntry(entry SitemapUrl) error
}
type SitemapUrl ¶ added in v0.3.0
type TokenPayload ¶ added in v0.2.0
type TokenPayload struct {
Email string `json:"email"`
}
Click to show internal directories.
Click to hide internal directories.