feat: initial commit
This commit is contained in:
21
internal/config/http.go
Normal file
21
internal/config/http.go
Normal file
@ -0,0 +1,21 @@
|
||||
package config
|
||||
|
||||
import "time"
|
||||
|
||||
type HTTP struct {
|
||||
BaseURL string `env:"BASE_URL" envDefault:"http://localhost:3001"`
|
||||
Address string `env:"ADDRESS,expand" envDefault:":3001"`
|
||||
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"`
|
||||
}
|
Reference in New Issue
Block a user