Documentation ¶
Index ¶
- func BinaryDecoder(payload io.Reader, dests ...interface{}) error
- func CryptoRandomNumber(max int64) int64
- func GenerateRand16(max int) uint16
- func GenerateRand32(max int) uint32
- func GetLastIP(ipNet *net.IPNet) (net.IP, error)
- func IPToNum(ip net.IP) uint32
- func IPto32(s string) uint32
- func NumToIP(num uint32) net.IP
- func RandStringBytes(n int) string
- func RandomIP(cidr string) (net.IP, error)
- func RandomNum(min, max int) int
- func SendPacket(conn *net.UDPConn, addr *net.UDPAddr, data bytes.Buffer, verbose bool) (int, error)
- func ToBytes(key interface{}) ([]byte, error)
- type StatCollector
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryDecoder ¶
BinaryDecoder decodes the given payload from a binary stream and puts it in dest
func CryptoRandomNumber ¶ added in v0.3.0
func GenerateRand16 ¶
GenerateRand16 Generates random uint16 num within the given max
func GenerateRand32 ¶
GenerateRand32 Generates a random uint32 within the given max
func RandStringBytes ¶
RandStringBytes Generates a random string of given length
func SendPacket ¶ added in v0.2.0
SendPacket Takes a given byte stream and puts on the wire towards the given host
Types ¶
type StatCollector ¶ added in v0.3.0
type StatCollector struct { StatsMap map[int]models.WorkerStat StatsChan chan models.WorkerStat StatsTotals models.StatTotals Config *models.Config }
StatCollector is used to gather stats about barrage and emit those stats via stdout and web ui
func (*StatCollector) DashboardHandler ¶ added in v0.3.1
func (sc *StatCollector) DashboardHandler(w http.ResponseWriter, r *http.Request)
DashboardHandler is used by web server to emit the Dashboard
func (*StatCollector) Run ¶ added in v0.3.0
func (sc *StatCollector) Run(wg *sync.WaitGroup, ctx context.Context)
Run is used to start the StatCollector
func (*StatCollector) StatsHandler ¶ added in v0.3.0
func (sc *StatCollector) StatsHandler(w http.ResponseWriter, r *http.Request)
StatsHandler is used by web server to emit stats as json
func (*StatCollector) Stop ¶ added in v0.3.0
func (sc *StatCollector) Stop()
Stop is used to close down the StatsChan gracefully