Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidSessionSecretLength = errors.New("session secret must be 16, 24, or 32 bytes")
Functions ¶
Types ¶
type ClientSecret ¶
type ClientSecret string
type Config ¶
type Config struct { ServerPort string `env:"SERVER_PORT" envDefault:"8080"` LogLevel slog.Level `env:"LOG_LEVEL"` LogType LogType `env:"LOG_TYPE" envDefault:"json"` ServerURL ServerURL `env:"SERVER_URL" envDefault:"https://fitbit.walnuts.dev/"` UserID UserID `env:"USER_ID,required"` ClientID ClientID `env:"CLIENT_ID,required"` ClientSecret ClientSecret `env:"CLIENT_SECRET,required"` CookieSecret CookieSecret `env:"COOKIE_SECRET,required"` PSQLDSN PSQLDSN `envPrefix:"PSQL_"` InfluxDBConfig InfluxDBConfig `envPrefix:"INFLUXDB_"` RecordStartDatetime *RecordStartDatetime `env:"RECORD_START_DATETIME"` }
type CookieSecret ¶
type CookieSecret string
func ParseCookieSecret ¶
func ParseCookieSecret(v string) (CookieSecret, error)
type InfluxDBConfig ¶
type PSQLDSN ¶
type PSQLDSN struct { Dsn string `env:"DSN" envDefault:""` PSQLHost string `env:"HOST" envDefault:"localhost"` PSQLPort string `env:"PORT" envDefault:"5432"` PSQLDatabase string `env:"DATABASE" envDefault:"fitbit_manager"` PSQLUser string `env:"USER" envDefault:"postgres"` PSQLPassword string `env:"PASSWORD,required"` PSQLSSLMode string `env:"SSL_MODE" envDefault:"disable"` PSQLTimeZone string `env:"TIMEZONE" envDefault:"Asia/Tokyo"` }
type RecordStartDatetime ¶
func ParseRecordStartDatetime ¶
func ParseRecordStartDatetime(v string) (RecordStartDatetime, error)
Click to show internal directories.
Click to hide internal directories.