23 lines
480 B
Go
23 lines
480 B
Go
package config
|
|
|
|
import "os"
|
|
|
|
type TwitterCredentials struct {
|
|
ClientID, ClientSecret, CallbackURL string
|
|
}
|
|
type Config struct {
|
|
PublicPath string
|
|
Twitter TwitterCredentials
|
|
}
|
|
|
|
func NewFromEnv() Config {
|
|
return Config{
|
|
PublicPath: os.Getenv("ELON_PUBLIC_PATH"),
|
|
Twitter: TwitterCredentials{
|
|
ClientID: os.Getenv("ELON_TWITTER_CLIENT_ID"),
|
|
ClientSecret: os.Getenv("ELON_TWITTER_CLIENT_SECRET"),
|
|
CallbackURL: os.Getenv("ELON_TWITTER_CALLBACK_URL"),
|
|
},
|
|
}
|
|
}
|