config

package
v0.6.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 4 Imported by: 7

Documentation

Overview

Package config stores config type.

Index

Constants

View Source
const CoreConfigKey = "core_config"

Variables

View Source
var DefaultConfig = Config{
	PortalUsername: "olive",
	PortalPassword: "olive",

	LogDir:                   "",
	SaveDir:                  "",
	OutTmpl:                  `[{{ .StreamerName }}][{{ .RoomName }}][{{ now | date "2006-01-02 15-04-05"}}].flv`,
	LogLevel:                 5,
	SnapRestSeconds:          15,
	SplitRestSeconds:         60,
	CommanderPoolSize:        1,
	ParserMonitorRestSeconds: 300,

	DouyinCookie:   "",
	KuaishouCookie: "",

	PostCmdsRetryCount: 2,
}

Functions

This section is empty.

Types

type Bout

type Bout interface {
	IsConfigValid() bool
	// show settings
	GetID() ID
	GetPlatform() string
	GetRoomID() string
	GetStreamerName() string
	GetOutFilename() string
	GetOutTmpl() string
	GetSaveDir() string
	GetParser() string
	GetPostCmds() []*exec.Cmd
	SatisfySplitRule(time.Time, string) bool

	// show events
	AddMonitor() error
	RemoveMonitor() error
	AddRecorder() error
	RemoveRecorder() error
	RestartRecorder()

	// tv
	Snap() error
	StreamURL() (string, bool)
	RoomName() (string, bool)
	StreamerName() (string, bool)
	SiteName() string
}

type Config

type Config struct {
	// portal
	PortalUsername string
	PortalPassword string

	// core
	LogDir                   string
	SaveDir                  string
	OutTmpl                  string
	LogLevel                 uint32
	SnapRestSeconds          uint
	SplitRestSeconds         uint
	CommanderPoolSize        uint
	ParserMonitorRestSeconds uint
	PostCmdsRetryCount       int

	// tv
	DouyinCookie   string
	KuaishouCookie string

	// biliup
	BiliupEnable      bool
	CookieFilepath    string
	Threads           int64
	MaxBytesPerSecond float64
}

func (*Config) CheckAndFix

func (cfg *Config) CheckAndFix()

type ID

type ID string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL