runtime

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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],
}

Functions

This section is empty.

Types

type Entry added in v1.4.3

type Entry struct {
	// contains filtered or unexported fields
}

type Runtime

type Runtime struct {
	Config *Storage
	// contains filtered or unexported fields
}

func NewRuntime

func NewRuntime(c context.Context) (r *Runtime, e error)

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 NewStorage added in v1.4.3

func NewStorage(c context.Context) (st *Storage, _ error)

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
)

Jump to

Keyboard shortcuts

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