Documentation ¶
Index ¶
- Constants
- func GenerateSecret() string
- type Auth
- type AuthGoogle
- type Backend
- type BackendS3
- type Podcast
- type PodcastDetails
- type PodcastS3
- type Storage
- type StoragePostgres
- func (s StoragePostgres) CreateUser(userID string) (string, error)
- func (s StoragePostgres) Init() error
- func (s StoragePostgres) LogFeed(secret, referer, userAgent string) error
- func (s StoragePostgres) LogPodcast(secret, key, referer, userAgent string) error
- func (s StoragePostgres) ValidSecret(secret string) (bool, error)
Constants ¶
View Source
const SecretSizeBytes = 36
SecretSizeBytes is the size of the secret in bytes, it should be a multiple of 12 to make sure it's encoded nicely in base64.
Variables ¶
This section is empty.
Functions ¶
func GenerateSecret ¶
func GenerateSecret() string
GenerateSecret generates `SecretSizeBytes` bytes of secure randomness and encodes it with URL safe base64.
Types ¶
type AuthGoogle ¶
type AuthGoogle struct {
// contains filtered or unexported fields
}
func NewAuthGoogle ¶
func NewAuthGoogle(clientID, clientSecret, authURL string) AuthGoogle
func (AuthGoogle) HandleAuth ¶
func (a AuthGoogle) HandleAuth(w http.ResponseWriter, r *http.Request, storage Storage, noSecureCookie bool) error
type BackendS3 ¶
type BackendS3 struct {
// contains filtered or unexported fields
}
func NewBackendS3 ¶
func (BackendS3) ListPodcasts ¶
type Podcast ¶
type Podcast interface { Details() PodcastDetails HandlePodcast(http.ResponseWriter, *http.Request) error }
type PodcastDetails ¶
type PodcastS3 ¶
type PodcastS3 struct {
// contains filtered or unexported fields
}
func (PodcastS3) Details ¶
func (p PodcastS3) Details() PodcastDetails
func (PodcastS3) HandlePodcast ¶
type StoragePostgres ¶
type StoragePostgres struct {
// contains filtered or unexported fields
}
func NewStoragePostgres ¶
func NewStoragePostgres(connectionString string) (StoragePostgres, error)
func (StoragePostgres) CreateUser ¶
func (s StoragePostgres) CreateUser(userID string) (string, error)
func (StoragePostgres) Init ¶
func (s StoragePostgres) Init() error
func (StoragePostgres) LogFeed ¶
func (s StoragePostgres) LogFeed(secret, referer, userAgent string) error
func (StoragePostgres) LogPodcast ¶
func (s StoragePostgres) LogPodcast(secret, key, referer, userAgent string) error
func (StoragePostgres) ValidSecret ¶
func (s StoragePostgres) ValidSecret(secret string) (bool, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.