mirror of
https://github.com/weyne85/chaturbate-dvr.git
synced 2025-10-29 16:58:56 +00:00
2.0.0 refactor
This commit is contained in:
26
config/config.go
Normal file
26
config/config.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/teacat/chaturbate-dvr/entity"
|
||||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
// New initializes a new Config struct with values from the CLI context.
|
||||
func New(c *cli.Context) (*entity.Config, error) {
|
||||
return &entity.Config{
|
||||
Version: c.App.Version,
|
||||
Username: c.String("username"),
|
||||
AdminUsername: c.String("admin-username"),
|
||||
AdminPassword: c.String("admin-password"),
|
||||
Framerate: c.Int("framerate"),
|
||||
Resolution: c.Int("resolution"),
|
||||
Pattern: c.String("pattern"),
|
||||
MaxDuration: c.Int("max-duration") * 60,
|
||||
MaxFilesize: c.Int("max-filesize"),
|
||||
Port: c.String("port"),
|
||||
Interval: c.Int("interval"),
|
||||
Cookies: c.String("cookies"),
|
||||
UserAgent: c.String("user-agent"),
|
||||
Domain: c.String("domain"),
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user