toggle

package
v0.0.0-...-85a9dc9 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key struct {
	ID   int64   `json:"id"`
	Rate float64 `json:"rate"`
	Name string  `json:"key"`
}

Key holds single toggle key params.

type Keys

type Keys []Key

Keys is a shorthand for []Key.

func (Keys) DisableByRate

func (k Keys) DisableByRate(total int64, counts []int64)

DisableByRate updates toggles states, switching off currently over-used toggles.

func (Keys) EnableByID

func (k Keys) EnableByID(ids []int64)

EnableByID enables keys by their id.

func (Keys) Names

func (k Keys) Names() (rv []string)

Names returns slice of toggles keys names.

Jump to

Keyboard shortcuts

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