Documentation ¶
Index ¶
- Variables
- func AWSConfigFromEnv() *aws.Config
- func AWSSession() *session.Session
- func AddCognitoFlags(cmd *cobra.Command, o *CognitoOptions)
- func AddDatabaseFlags(cmd *cobra.Command, o *DatabaseOptions)
- func AddIAMFlags(cmd *cobra.Command, o *IAMOptions)
- func AddKeyCloakFlags(cmd *cobra.Command, o *KeyCloakOptions)
- func AddMongoFlags(cmd *cobra.Command, o *MongoOptions)
- func AddPostgresFlags(cmd *cobra.Command, out *PostgresOptions)
- func AddRedisFlags(cmd *cobra.Command, o *RedisOptions)
- func AddServerFlags(cmd *cobra.Command, out *ServerOptions)
- func AddServiceFlags(cmd *cobra.Command, name string, out *ServiceOptions, ...)
- func CheckEnv(name string, target *string) string
- func CheckEnvBool(name string, target *bool) bool
- func CheckEnvInt(name string, target *int) int
- func CheckEnvInt64(name string, target *int64) int64
- func ConnectMongo(o *MongoOptions) *mongo.Database
- func ConnectPostgres(o *PostgresOptions) *sql.DB
- func ConnectRedis(o *RedisOptions) *redis.Client
- func Contains(arr []string, v string) bool
- func Elapsed(since time.Time) zap.Field
- func ExtractChannelID(input string) (string, error)
- func ExtractPlaylistID(input string) (string, error)
- func ExtractVideoID(input string) (string, error)
- func HealthHandler(w http.ResponseWriter, r *http.Request)
- func IAMEnv(o *IAMOptions, required bool)
- func InvalidMethod(method string) error
- func Lerp(a float64, b float64, f float64) float64
- func MapContainsAll(p map[string]interface{}, keys ...string) bool
- func MapContainsAny(p map[string]interface{}, keys ...string) bool
- func Progress(ctx context.Context, onProgress chan<- struct{})
- func ProgressDownload(ctx context.Context, onProgress chan<- *DownloadProgress)
- func RandomizeSeed()
- func ReadyHandler(w http.ResponseWriter, r *http.Request)
- func RunMetrics(port int, log *zap.Logger)
- func SetLogLevel()
- func SignalReady(log *zap.Logger)
- func WaitForService(opts *ServiceOptions)
- func WaitForServices(opts []*ServiceOptions)
- type BasicAuth
- type CognitoOptions
- type DatabaseDriver
- type DatabaseOptions
- type DownloadProgress
- type IAMDriver
- type IAMOptions
- type KeyCloak
- type KeyCloakAdminOptions
- type KeyCloakOptions
- type MongoOptions
- type PostgresOptions
- type RedisOptions
- type ServerOptions
- type ServiceOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultLog *zap.Logger
View Source
var ErrNoPlaylistID = errors.New("url query is missing playlist id")
View Source
var ErrNoVideoID = errors.New("url query is missing video id")
View Source
var Unreachable string = "unreachable branch detected"
Functions ¶
func AWSConfigFromEnv ¶
func AWSSession ¶
func AddCognitoFlags ¶
func AddCognitoFlags(cmd *cobra.Command, o *CognitoOptions)
func AddDatabaseFlags ¶
func AddDatabaseFlags(cmd *cobra.Command, o *DatabaseOptions)
func AddIAMFlags ¶
func AddIAMFlags(cmd *cobra.Command, o *IAMOptions)
func AddKeyCloakFlags ¶
func AddKeyCloakFlags(cmd *cobra.Command, o *KeyCloakOptions)
func AddMongoFlags ¶
func AddMongoFlags(cmd *cobra.Command, o *MongoOptions)
func AddPostgresFlags ¶
func AddPostgresFlags(cmd *cobra.Command, out *PostgresOptions)
func AddRedisFlags ¶
func AddRedisFlags(cmd *cobra.Command, o *RedisOptions)
func AddServerFlags ¶
func AddServerFlags(cmd *cobra.Command, out *ServerOptions)
func AddServiceFlags ¶
func CheckEnvBool ¶
func CheckEnvInt ¶
func CheckEnvInt64 ¶
func ConnectMongo ¶
func ConnectMongo(o *MongoOptions) *mongo.Database
func ConnectPostgres ¶
func ConnectPostgres(o *PostgresOptions) *sql.DB
func ConnectRedis ¶
func ConnectRedis(o *RedisOptions) *redis.Client
func ExtractChannelID ¶
func ExtractPlaylistID ¶
func ExtractVideoID ¶
func HealthHandler ¶
func HealthHandler(w http.ResponseWriter, r *http.Request)
func IAMEnv ¶
func IAMEnv(o *IAMOptions, required bool)
func InvalidMethod ¶
func MapContainsAll ¶
func MapContainsAny ¶
func ProgressDownload ¶
func ProgressDownload( ctx context.Context, onProgress chan<- *DownloadProgress, )
func RandomizeSeed ¶
func RandomizeSeed()
func ReadyHandler ¶
func ReadyHandler(w http.ResponseWriter, r *http.Request)
func RunMetrics ¶
func SetLogLevel ¶
func SetLogLevel()
func SignalReady ¶
func WaitForService ¶
func WaitForService(opts *ServiceOptions)
func WaitForServices ¶
func WaitForServices(opts []*ServiceOptions)
Types ¶
type CognitoOptions ¶
type CognitoOptions struct { UserPoolID string ClientID string ClientSecret string AllowTokenUseBeforeIssue bool }
func CognitoEnv ¶
func CognitoEnv(o *CognitoOptions, required bool) *CognitoOptions
func (*CognitoOptions) Ensure ¶
func (o *CognitoOptions) Ensure()
func (*CognitoOptions) IsSet ¶
func (o *CognitoOptions) IsSet() bool
type DatabaseDriver ¶
type DatabaseDriver string
var ( MongoDriver DatabaseDriver = "mongo" PostgresDriver DatabaseDriver = "postgres" )
func (DatabaseDriver) IsValid ¶
func (d DatabaseDriver) IsValid() bool
type DatabaseOptions ¶
type DatabaseOptions struct { Driver DatabaseDriver Mongo MongoOptions Postgres PostgresOptions }
func DatabaseEnv ¶
func DatabaseEnv(o *DatabaseOptions, required bool) *DatabaseOptions
func (*DatabaseOptions) IsSet ¶
func (o *DatabaseOptions) IsSet() bool
type DownloadProgress ¶
type IAMOptions ¶
type IAMOptions struct { Driver IAMDriver KeyCloak KeyCloakOptions Cognito CognitoOptions }
type KeyCloak ¶
type KeyCloak struct { *gocloak.GoCloak KeyCloakOptions Token *gocloak.JWT // contains filtered or unexported fields }
func ConnectKeyCloak ¶
func ConnectKeyCloak(o *KeyCloakOptions) *KeyCloak
type KeyCloakAdminOptions ¶
type KeyCloakOptions ¶
type KeyCloakOptions struct { Endpoint string Admin KeyCloakAdminOptions ClientID string ClientSecret string Realm string }
func KeyCloakEnv ¶
func KeyCloakEnv(o *KeyCloakOptions, required bool) *KeyCloakOptions
func (*KeyCloakOptions) Ensure ¶
func (o *KeyCloakOptions) Ensure()
func (*KeyCloakOptions) IsSet ¶
func (o *KeyCloakOptions) IsSet() bool
type MongoOptions ¶
type MongoOptions struct { DBName string `json:"dbName"` Host string `json:"host"` AuthSource string `json:"authSource"` Username string `json:"username"` Password string `json:"password"` }
func MongoEnv ¶
func MongoEnv(o *MongoOptions, required bool) *MongoOptions
func (*MongoOptions) Ensure ¶
func (o *MongoOptions) Ensure()
func (*MongoOptions) IsSet ¶
func (o *MongoOptions) IsSet() bool
type PostgresOptions ¶
type PostgresOptions struct { Host string Port int Username string Password string Database string SSLMode string SSLKeyPath string }
func PostgresEnv ¶
func PostgresEnv(o *PostgresOptions, required bool) *PostgresOptions
func (*PostgresOptions) Ensure ¶
func (o *PostgresOptions) Ensure()
func (*PostgresOptions) IsSet ¶
func (p *PostgresOptions) IsSet() bool
type RedisOptions ¶
func RedisEnv ¶
func RedisEnv(o *RedisOptions, required bool) *RedisOptions
func (*RedisOptions) ConnectionString ¶
func (o *RedisOptions) ConnectionString() string
func (*RedisOptions) IsSet ¶
func (o *RedisOptions) IsSet() bool
type ServerOptions ¶
func ServerEnv ¶
func ServerEnv(o *ServerOptions) *ServerOptions
type ServiceOptions ¶
func ServiceEnv ¶
func ServiceEnv(name string, o *ServiceOptions) *ServiceOptions
func (*ServiceOptions) HasBasicAuth ¶
func (o *ServiceOptions) HasBasicAuth() bool
func (*ServiceOptions) HasTimeout ¶
func (o *ServiceOptions) HasTimeout() bool
func (*ServiceOptions) WithBasicAuth ¶
func (o *ServiceOptions) WithBasicAuth(username, password string) *ServiceOptions
func (*ServiceOptions) WithTimeout ¶
func (o *ServiceOptions) WithTimeout(timeout time.Duration) *ServiceOptions
Source Files ¶
- aws.go
- check_env.go
- cognito.go
- contains.go
- database.go
- extract_channel_id.go
- extract_playlist_id.go
- extract_video_id.go
- health.go
- iam.go
- invalid_method.go
- keycloak.go
- lerp.go
- log.go
- mongo.go
- postgres.go
- progress.go
- randomize_seed.go
- ready.go
- redis.go
- run_metrics.go
- server.go
- service.go
- unreachable.go
- wait_for_service.go
Click to show internal directories.
Click to hide internal directories.