Documentation ¶
Index ¶
- Variables
- type Entry
- type Runtime
- type RuntimePatch
- func (m *RuntimePatch) ApplyBlocklistIps(_ *Storage, bl *blocklist.Blocklist) (e error)
- func (m *RuntimePatch) ApplyLogLevel(st *Storage, param StorageParam) (e error)
- func (m *RuntimePatch) ApplyLotteryChance(st *Storage) (e error)
- func (m *RuntimePatch) ApplyQualityLevel(st *Storage) (e error)
- func (m *RuntimePatch) ApplySwitch(st *Storage, param StorageParam) (e error)
- type RuntimePatchType
- type Storage
- type StorageParam
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrRuntimeUndefinedPatch = errors.New("given patch payload is undefined") RuntimeUtilsBindings = map[string]RuntimePatchType{ utils.CfgLotteryChance: RuntimePatchLottery, utils.CfgQualityLevel: RuntimePatchQuality, utils.CfgBlockList: RuntimePatchBlocklistIps, utils.CfgBlockListSwitcher: RuntimePatchBlocklist, utils.CfgLimiterSwitcher: RuntimePatchLimiter, utils.CfgAccessLogStdout: RuntimePatchAccessStdout, utils.CfgAccessLogLevel: RuntimePatchAccessLevel, } )
View Source
var (
ErrConfigInvalidStep = errors.New("config storage - softer-step must be >= 0 and < 100")
)
View Source
var GetNameByParam = map[StorageParam]string{ ParamLottery: runtimeChangesHumanize[RuntimePatchLottery], ParamQuality: runtimeChangesHumanize[RuntimePatchQuality], ParamBlocklist: runtimeChangesHumanize[RuntimePatchBlocklist], ParamBlocklistIps: runtimeChangesHumanize[RuntimePatchBlocklistIps], ParamLimiter: runtimeChangesHumanize[RuntimePatchLimiter], ParamAccessStdout: runtimeChangesHumanize[RuntimePatchAccessStdout], ParamAccessLevel: runtimeChangesHumanize[RuntimePatchAccessLevel], }
View Source
var ParamDefaults = map[StorageParam]interface{}{ ParamLottery: 100, ParamQuality: utils.TitleQualityHD, ParamBlocklist: 1, ParamBlocklistIps: []string{}, ParamLimiter: 0, ParamAccessStdout: 1, ParamAccessLevel: zerolog.InfoLevel, }
Functions ¶
This section is empty.
Types ¶
type Runtime ¶
type Runtime struct { Config *Storage // contains filtered or unexported fields }
func (*Runtime) ApplyPatch ¶
func (m *Runtime) ApplyPatch(patch *RuntimePatch) (e error)
type RuntimePatch ¶
type RuntimePatch struct { Type RuntimePatchType Patch []byte }
func (*RuntimePatch) ApplyBlocklistIps ¶ added in v1.4.3
func (m *RuntimePatch) ApplyBlocklistIps(_ *Storage, bl *blocklist.Blocklist) (e error)
func (*RuntimePatch) ApplyLogLevel ¶ added in v1.4.3
func (m *RuntimePatch) ApplyLogLevel(st *Storage, param StorageParam) (e error)
func (*RuntimePatch) ApplyLotteryChance ¶ added in v1.4.3
func (m *RuntimePatch) ApplyLotteryChance(st *Storage) (e error)
func (*RuntimePatch) ApplyQualityLevel ¶ added in v1.4.3
func (m *RuntimePatch) ApplyQualityLevel(st *Storage) (e error)
func (*RuntimePatch) ApplySwitch ¶ added in v1.4.3
func (m *RuntimePatch) ApplySwitch(st *Storage, param StorageParam) (e error)
type RuntimePatchType ¶
type RuntimePatchType uint8
const ( RuntimePatchLottery RuntimePatchType = iota RuntimePatchQuality RuntimePatchBlocklist RuntimePatchBlocklistIps RuntimePatchLimiter RuntimePatchAccessStdout RuntimePatchAccessLevel )
type Storage ¶ added in v1.4.3
type Storage struct {
// contains filtered or unexported fields
}
func (*Storage) Get ¶ added in v1.4.3
func (m *Storage) Get(param StorageParam) interface{}
func (*Storage) Set ¶ added in v1.4.3
func (m *Storage) Set(param StorageParam, val interface{})
func (*Storage) SetSmoothly ¶ added in v1.4.3
func (m *Storage) SetSmoothly(param StorageParam, val interface{})
type StorageParam ¶ added in v1.4.3
type StorageParam uint8
const ( ParamLottery StorageParam = iota ParamQuality ParamBlocklist ParamBlocklistIps ParamLimiter ParamAccessStdout ParamAccessLevel )
Click to show internal directories.
Click to hide internal directories.