22 lines
593 B
Go
22 lines
593 B
Go
|
package config
|
||
|
|
||
|
import "time"
|
||
|
|
||
|
type HTTP struct {
|
||
|
BaseURL string `env:"BASE_URL" envDefault:"http://localhost:3000"`
|
||
|
Address string `env:"ADDRESS,expand" envDefault:":3000"`
|
||
|
Session Session `envPrefix:"SESSION_"`
|
||
|
}
|
||
|
|
||
|
type Session struct {
|
||
|
Keys []string `env:"KEYS"`
|
||
|
Cookie Cookie `envPrefix:"COOKIE_"`
|
||
|
}
|
||
|
|
||
|
type Cookie struct {
|
||
|
Path string `env:"PATH,expand" envDefault:"/"`
|
||
|
HTTPOnly bool `env:"HTTP_ONLY,expand" envDefault:"true"`
|
||
|
Secure bool `env:"SECURE,expand" envDefault:"false"`
|
||
|
MaxAge time.Duration `env:"MAX_AGE,expand" envDefault:"24h"`
|
||
|
}
|