Documentation
¶
Index ¶
- type AccessTokenRow
- type AuthCodeRow
- type AuthStore
- type AuthStorePG
- func (a *AuthStorePG) DeleteSession(ctx context.Context, id uuid.UUID) error
- func (a *AuthStorePG) DeleteUser(ctx context.Context, id uuid.UUID) error
- func (a *AuthStorePG) GetSession(ctx context.Context, id uuid.UUID) (*SessionRow, error)
- func (a *AuthStorePG) GetSessionAndUser(ctx context.Context, sessionID uuid.UUID) (*SessionRow, *UserRow, error)
- func (a *AuthStorePG) GetUserByEmail(ctx context.Context, email string) (*UserRow, error)
- func (a *AuthStorePG) GetUserByID(ctx context.Context, id uuid.UUID) (*UserRow, error)
- func (a *AuthStorePG) GetUserByUsername(ctx context.Context, username string) (*UserRow, error)
- func (a *AuthStorePG) InsertSession(ctx context.Context, s *SessionRow) error
- func (a *AuthStorePG) InsertUser(ctx context.Context, u *UserRow) error
- func (a *AuthStorePG) UpdateSession(ctx context.Context, s *SessionRow) error
- func (a *AuthStorePG) UpdateUser(ctx context.Context, u *UserRow) error
- func (a AuthStorePG) UpdateUserPassword(ctx context.Context, id uuid.UUID, password_hash []byte) error
- type Category
- type Episode
- type OAuthStore
- type OAuthStorePG
- func (o *OAuthStorePG) DeleteAccessToken(ctx context.Context, token []byte) error
- func (o *OAuthStorePG) DeleteAuthCode(ctx context.Context, code []byte) error
- func (o *OAuthStorePG) GetAccessTokenAndUser(ctx context.Context, token []byte) (*UserRow, *AccessTokenRow, error)
- func (o *OAuthStorePG) GetAccessTokenByRefresh(ctx context.Context, refreshToken []byte) (*AccessTokenRow, error)
- func (o *OAuthStorePG) GetAuthCode(ctx context.Context, code []byte) (*AuthCodeRow, error)
- func (o *OAuthStorePG) InsertAccessToken(ctx context.Context, a *AccessTokenRow) error
- func (o *OAuthStorePG) InsertAuthCode(ctx context.Context, a *AuthCodeRow) error
- type Podcast
- type PodcastStore
- func (ps *PodcastStore) DeleteSubscription(ctx context.Context, uID uuid.UUID, pID uuid.UUID) error
- func (p *PodcastStore) FindAllCategories(ctx context.Context) ([]Category, error)
- func (p *PodcastStore) FindEpisodeByID(ctx context.Context, epiID uuid.UUID) (*Episode, error)
- func (p *PodcastStore) FindEpisodeByURL(ctx context.Context, podID uuid.UUID, mp3URL string) (*Episode, error)
- func (p *PodcastStore) FindEpisodeNumber(ctx context.Context, podID uuid.UUID, season, episode int) (*Episode, error)
- func (ps *PodcastStore) FindEpisodesByRange(ctx context.Context, podID uuid.UUID, start, end int64) ([]Episode, error)
- func (ps *PodcastStore) FindLastPlayed(ctx context.Context, userID uuid.UUID) (*UserEpisode, *Podcast, *Episode, error)
- func (p *PodcastStore) FindLastUserEpi(ctx context.Context, userID uuid.UUID) (*UserEpisode, error)
- func (p *PodcastStore) FindLatestEpisode(ctx context.Context, podID uuid.UUID) (*Episode, error)
- func (ps *PodcastStore) FindPodcastByID(ctx context.Context, id uuid.UUID) (*Podcast, error)
- func (ps *PodcastStore) FindPodcastByRSS(ctx context.Context, rssURL string) (*Podcast, error)
- func (ps *PodcastStore) FindPodcastsByRange(ctx context.Context, start int, end int) ([]Podcast, error)
- func (ps *PodcastStore) FindSubscriptions(ctx context.Context, userID uuid.UUID) ([]Subscription, error)
- func (p *PodcastStore) FindUserEpisode(ctx context.Context, userID, epiID uuid.UUID) (*UserEpisode, error)
- func (p *PodcastStore) InsertCategory(ctx context.Context, cat *Category) error
- func (p *PodcastStore) InsertEpisode(ctx context.Context, e *Episode) error
- func (ps *PodcastStore) InsertPodcast(ctx context.Context, p *Podcast) error
- func (ps *PodcastStore) InsertSubscription(ctx context.Context, sub *Subscription) error
- func (ps *PodcastStore) SearchPodcasts(ctx context.Context, search string) ([]Podcast, error)
- func (p *PodcastStore) UpsertUserEpisode(ctx context.Context, userEpi *UserEpisode) error
- type Scope
- type SessionRow
- type Subscription
- type UserEpisode
- type UserRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessTokenRow ¶
type AccessTokenRow struct { Token []byte `json:"token"` AuthCode []byte `json:"auth_code"` RefreshToken []byte `json:"refresh_token"` UserID uuid.UUID `json:"user_id"` Created time.Time `json:"created"` Expires int `json:"expires"` }
AccessToken contains the information to provide user access within oAuth scope
type AuthCodeRow ¶
type AuthCodeRow struct { Code []byte `json:"code"` ClientID string `json:"client_id"` UserID uuid.UUID `json:"user_id"` Scope Scope `json:"scope"` Expires time.Time `json:"expires"` }
AuthCode is the authorization code of oauth2.0 code is the primary key
type AuthStore ¶
type AuthStore interface { // User InsertUser(ctx context.Context, u *UserRow) error GetUserByID(ctx context.Context, id uuid.UUID) (*UserRow, error) GetUserByEmail(ctx context.Context, email string) (*UserRow, error) GetUserByUsername(ctx context.Context, username string) (*UserRow, error) UpdateUser(ctx context.Context, u *UserRow) error UpdateUserPassword(ctx context.Context, id uuid.UUID, password_hash []byte) error DeleteUser(ctx context.Context, id uuid.UUID) error // Session InsertSession(ctx context.Context, s *SessionRow) error GetSession(ctx context.Context, id uuid.UUID) (*SessionRow, error) UpdateSession(ctx context.Context, s *SessionRow) error DeleteSession(ctx context.Context, id uuid.UUID) error // Both GetSessionAndUser(ctx context.Context, sessionID uuid.UUID) (*SessionRow, *UserRow, error) }
type AuthStorePG ¶
type AuthStorePG struct {
// contains filtered or unexported fields
}
func NewAuthStorePG ¶
func NewAuthStorePG(db *pgxpool.Pool) *AuthStorePG
func (*AuthStorePG) DeleteSession ¶
func (*AuthStorePG) DeleteUser ¶
func (*AuthStorePG) GetSession ¶
func (a *AuthStorePG) GetSession(ctx context.Context, id uuid.UUID) (*SessionRow, error)
func (*AuthStorePG) GetSessionAndUser ¶
func (a *AuthStorePG) GetSessionAndUser(ctx context.Context, sessionID uuid.UUID) (*SessionRow, *UserRow, error)
func (*AuthStorePG) GetUserByEmail ¶
func (*AuthStorePG) GetUserByID ¶
func (*AuthStorePG) GetUserByUsername ¶
func (*AuthStorePG) InsertSession ¶
func (a *AuthStorePG) InsertSession(ctx context.Context, s *SessionRow) error
Session
func (*AuthStorePG) InsertUser ¶
func (a *AuthStorePG) InsertUser(ctx context.Context, u *UserRow) error
User
func (*AuthStorePG) UpdateSession ¶
func (a *AuthStorePG) UpdateSession(ctx context.Context, s *SessionRow) error
func (*AuthStorePG) UpdateUser ¶
func (a *AuthStorePG) UpdateUser(ctx context.Context, u *UserRow) error
func (AuthStorePG) UpdateUserPassword ¶
type Episode ¶
type Episode struct { // REQUIRED ID uuid.UUID Title string EnclosureURL string EnclosureLength int64 EnclosureType string // RECOMMENDED PubDate time.Time Description string Duration int64 LinkURL string ImageURL string ImageTitle string Explicit string // SITUATIONAL Episode int Season int EpisodeType string //Block bool // OTHER Subtitle string Summary string Encoded string PodcastID uuid.UUID }
Episode holds information about a single episode of a podcast within the rss feed
type OAuthStore ¶
type OAuthStore interface { // Auth Code InsertAuthCode(ctx context.Context, a *AuthCodeRow) error GetAuthCode(ctx context.Context, code []byte) (*AuthCodeRow, error) // UpdateAuthCode(ctx context.Context, a *AuthCodeRow) error DeleteAuthCode(ctx context.Context, code []byte) error // Access Token InsertAccessToken(ctx context.Context, a *AccessTokenRow) error GetAccessTokenByRefresh(ctx context.Context, refreshToken []byte) (*AccessTokenRow, error) DeleteAccessToken(ctx context.Context, token []byte) error GetAccessTokenAndUser(ctx context.Context, token []byte) (*UserRow, *AccessTokenRow, error) }
type OAuthStorePG ¶
type OAuthStorePG struct {
// contains filtered or unexported fields
}
func NewOAuthStorePG ¶
func NewOAuthStorePG(db *pgxpool.Pool) *OAuthStorePG
func (*OAuthStorePG) DeleteAccessToken ¶
func (o *OAuthStorePG) DeleteAccessToken(ctx context.Context, token []byte) error
func (*OAuthStorePG) DeleteAuthCode ¶
func (o *OAuthStorePG) DeleteAuthCode(ctx context.Context, code []byte) error
func (*OAuthStorePG) GetAccessTokenAndUser ¶
func (o *OAuthStorePG) GetAccessTokenAndUser(ctx context.Context, token []byte) (*UserRow, *AccessTokenRow, error)
func (*OAuthStorePG) GetAccessTokenByRefresh ¶
func (o *OAuthStorePG) GetAccessTokenByRefresh(ctx context.Context, refreshToken []byte) (*AccessTokenRow, error)
func (*OAuthStorePG) GetAuthCode ¶
func (o *OAuthStorePG) GetAuthCode(ctx context.Context, code []byte) (*AuthCodeRow, error)
func (*OAuthStorePG) InsertAccessToken ¶
func (o *OAuthStorePG) InsertAccessToken(ctx context.Context, a *AccessTokenRow) error
func (*OAuthStorePG) InsertAuthCode ¶
func (o *OAuthStorePG) InsertAuthCode(ctx context.Context, a *AuthCodeRow) error
type Podcast ¶
type Podcast struct { // REQUIRED ID uuid.UUID Title string Description string ImageURL string Language string Category []int Explicit string // RECOMMENDED Author string LinkURL string OwnerName string OwnerEmail string // SITUATIONAL Episodic bool Copyright string Block bool Complete bool // RSS/OTHER PubDate time.Time Keywords string Summary string RSSURL string }
Podcast contains information and xml struct tags for podcast
type PodcastStore ¶
type PodcastStore struct {
// contains filtered or unexported fields
}
func NewPodcastStore ¶
func NewPodcastStore(db *pgxpool.Pool) *PodcastStore
func (*PodcastStore) DeleteSubscription ¶
func (*PodcastStore) FindAllCategories ¶
func (p *PodcastStore) FindAllCategories(ctx context.Context) ([]Category, error)
func (*PodcastStore) FindEpisodeByID ¶
func (*PodcastStore) FindEpisodeByURL ¶
func (*PodcastStore) FindEpisodeNumber ¶
func (*PodcastStore) FindEpisodesByRange ¶
func (*PodcastStore) FindLastPlayed ¶
func (ps *PodcastStore) FindLastPlayed(ctx context.Context, userID uuid.UUID) (*UserEpisode, *Podcast, *Episode, error)
func (*PodcastStore) FindLastUserEpi ¶
func (p *PodcastStore) FindLastUserEpi(ctx context.Context, userID uuid.UUID) (*UserEpisode, error)
func (*PodcastStore) FindLatestEpisode ¶
func (*PodcastStore) FindPodcastByID ¶
func (*PodcastStore) FindPodcastByRSS ¶
func (*PodcastStore) FindPodcastsByRange ¶
func (*PodcastStore) FindSubscriptions ¶
func (ps *PodcastStore) FindSubscriptions(ctx context.Context, userID uuid.UUID) ([]Subscription, error)
func (*PodcastStore) FindUserEpisode ¶
func (p *PodcastStore) FindUserEpisode(ctx context.Context, userID, epiID uuid.UUID) (*UserEpisode, error)
func (*PodcastStore) InsertCategory ¶
func (p *PodcastStore) InsertCategory(ctx context.Context, cat *Category) error
func (*PodcastStore) InsertEpisode ¶
func (p *PodcastStore) InsertEpisode(ctx context.Context, e *Episode) error
func (*PodcastStore) InsertPodcast ¶
func (ps *PodcastStore) InsertPodcast(ctx context.Context, p *Podcast) error
Podcast stuff
func (*PodcastStore) InsertSubscription ¶
func (ps *PodcastStore) InsertSubscription(ctx context.Context, sub *Subscription) error
func (*PodcastStore) SearchPodcasts ¶
func (*PodcastStore) UpsertUserEpisode ¶
func (p *PodcastStore) UpsertUserEpisode(ctx context.Context, userEpi *UserEpisode) error
type SessionRow ¶
type SessionRow struct { ID uuid.UUID UserID uuid.UUID LoginTime time.Time LastSeenTime time.Time Expires time.Time UserAgent string }
SessionRow contains all session information
type Subscription ¶
type UserEpisode ¶
Click to show internal directories.
Click to hide internal directories.